fix assignment of class labels
by using the indices from the sorted distance vector of pairs.
This commit is contained in:
parent
3d2fc6c2fd
commit
47cdb041f2
@ -104,7 +104,7 @@ void createConcentricSpheresTestSet( int num_samples, int num_features, int num_
|
|||||||
max_dst = std::max( max_dst, dis[i].d );
|
max_dst = std::max( max_dst, dis[i].d );
|
||||||
|
|
||||||
for( ; i < num_samples && dis[i].d <= max_dst; ++i )
|
for( ; i < num_samples && dis[i].d <= max_dst; ++i )
|
||||||
responses.at<int>(i) = cur_class;
|
responses.at<int>(dis[i].i) = cur_class;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user