From 5a5ec05153687829568fc70acac28fc6d7425f60 Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 2 Sep 2011 18:08:38 -0400 Subject: [PATCH] Updated same so it compiles with the current version of the krr_trainer. --- examples/using_custom_kernels_ex.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/using_custom_kernels_ex.cpp b/examples/using_custom_kernels_ex.cpp index 412d461e0..819958062 100644 --- a/examples/using_custom_kernels_ex.cpp +++ b/examples/using_custom_kernels_ex.cpp @@ -184,11 +184,12 @@ int main() // tell the trainer the parameters we want to use trainer.set_kernel(kernel_type(sigma)); - double loo_error; - trainer.train(samples, labels, loo_error); + std::vector loo_values; + trainer.train(samples, labels, loo_values); - // Print sigma and the fraction of samples misclassified during LOO cross-validation. - cout << "sigma: " << sigma << " LOO error: " << loo_error << endl; + // Print sigma and the fraction of samples correctly classified during LOO cross-validation. + const double classification_accuracy = mean_sign_agreement(labels, loo_values); + cout << "sigma: " << sigma << " LOO accuracy: " << classification_accuracy << endl; }