From 8c79cdfe817d8ea2fb25f60e570a48acdef027be Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 5 Jul 2008 17:18:12 +0000 Subject: [PATCH] updated this example --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402376 --- examples/kkmeans_ex.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/kkmeans_ex.cpp b/examples/kkmeans_ex.cpp index 44cb4d462..02e23cf92 100644 --- a/examples/kkmeans_ex.cpp +++ b/examples/kkmeans_ex.cpp @@ -114,10 +114,8 @@ int main() // n points that are far apart (basically). 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 - // its arguments to be dlib::matrix objects so since we have our samples in std::vector objects - // 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 run the k-means algorithm on our set of samples. + test.train(samples,initial_centers); // now loop over all our samples and print out their predicted class. In this example // all points are correctly identified.