Commit aa76eec3 authored by Davis King's avatar Davis King

Changed the cross_validate_trainer() function so that it catches

invalid_svm_nu_error exceptions and just gives them a bad score rather
than letting them get out and annoy the user.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402900
parent f61ef323
...@@ -464,8 +464,17 @@ namespace dlib ...@@ -464,8 +464,17 @@ namespace dlib
train_neg_idx = (train_neg_idx+1)%x.nr(); train_neg_idx = (train_neg_idx+1)%x.nr();
} }
try
{
// do the training and testing // do the training and testing
res += test_binary_decision_function(trainer.train(x_train,y_train),x_test,y_test); res += test_binary_decision_function(trainer.train(x_train,y_train),x_test,y_test);
}
catch (invalid_svm_nu_error&)
{
// Just ignore the error in this case since we are going to
// interpret an invalid nu value the same as generating a decision
// function that miss-classifies everything.
}
} // for (long i = 0; i < folds; ++i) } // for (long i = 0; i < folds; ++i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment