updated this example

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402376
This commit is contained in:
Davis King 2008-07-05 17:18:12 +00:00
parent 84c1595571
commit 8c79cdfe81
1 changed files with 2 additions and 4 deletions

View File

@ -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.