mirror of https://github.com/davisking/dlib.git
updated this example
--HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402376
This commit is contained in:
parent
84c1595571
commit
8c79cdfe81
|
@ -114,10 +114,8 @@ int main()
|
||||||
// n points that are far apart (basically).
|
// n points that are far apart (basically).
|
||||||
pick_initial_centers(3, initial_centers, samples, test.get_kernel());
|
pick_initial_centers(3, initial_centers, samples, test.get_kernel());
|
||||||
|
|
||||||
// now run the k-means algorithm on our set of samples. Note that the train function expects
|
// now run the k-means algorithm on our set of samples.
|
||||||
// its arguments to be dlib::matrix objects so since we have our samples in std::vector objects
|
test.train(samples,initial_centers);
|
||||||
// we need to turn them into matrix objects. The vector_to_matrix() function does this for us.
|
|
||||||
test.train(vector_to_matrix(samples),vector_to_matrix(initial_centers));
|
|
||||||
|
|
||||||
// now loop over all our samples and print out their predicted class. In this example
|
// now loop over all our samples and print out their predicted class. In this example
|
||||||
// all points are correctly identified.
|
// all points are correctly identified.
|
||||||
|
|
Loading…
Reference in New Issue