File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -21,16 +21,6 @@ void svmProblem::groupClasses() {
2121 count.push_back (1 );
2222 }
2323 }
24- start.push_back (0 );
25- for (int i = 1 ; i < count.size (); ++i) {
26- start.push_back (start[i - 1 ] + count[i - 1 ]);
27- }
28- vector<int > _start (start);
29- perm = vector<int >(v_nLabels.size ());
30- for (int i = 0 ; i < v_nLabels.size (); ++i) {
31- perm[_start[dataLabel[i]]] = i;
32- _start[dataLabel[i]]++;
33- }
3424
3525// Labels are ordered by their first occurrence in the training set.
3626// However, for two-class sets with -1/+1 labels and -1 appears first,
@@ -49,6 +39,17 @@ void svmProblem::groupClasses() {
4939 dataLabel[i] = 0 ;
5040 }
5141 }
42+
43+ start.push_back (0 );
44+ for (int i = 1 ; i < count.size (); ++i) {
45+ start.push_back (start[i - 1 ] + count[i - 1 ]);
46+ }
47+ vector<int > _start (start);
48+ perm = vector<int >(v_nLabels.size ());
49+ for (int i = 0 ; i < v_nLabels.size (); ++i) {
50+ perm[_start[dataLabel[i]]] = i;
51+ _start[dataLabel[i]]++;
52+ }
5253}
5354
5455svmProblem svmProblem::getSubProblem (int i, int j) const {
You can’t perform that action at this time.
0 commit comments