From b51cc5c295c537d3ef3b6444931ce13afa513719 Mon Sep 17 00:00:00 2001 From: Davis King Date: Sat, 5 Jul 2008 17:32:47 +0000 Subject: [PATCH] made this exampler simpler --HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402379 --- examples/rank_features_ex.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/rank_features_ex.cpp b/examples/rank_features_ex.cpp index 32fc1a150..1c7b0911d 100644 --- a/examples/rank_features_ex.cpp +++ b/examples/rank_features_ex.cpp @@ -104,12 +104,8 @@ int main() kcentroid kc(kernel_type(0.05), 0.001); // And finally we get to the feature ranking. Here we call rank_features() with the kcentroid we just made, - // the samples and labels we made above, and the number of features we want it to rank. Note that - // rank_features() operates on dlib::matrix objects so we need to use the vector_to_matrix() function - // to cast the std::vector objects to dlib::matrix. Also note that the vector_to_matrix() doesn't actually - // copy the std::vector, but instead it uses a template expression technique to recast it as a dlib::matrix - // object. (see the dlib::matrix example and documentation for more details on template expressions). - cout << rank_features(kc, vector_to_matrix(samples), vector_to_matrix(labels), 4) << endl; + // the samples and labels we made above, and the number of features we want it to rank. + cout << rank_features(kc, samples, labels, 4) << endl; // The output is: /*