13 using namespace shark;
22 void draw(RealVector& input,
unsigned int& label)
const 34 unsigned int ell = 30;
35 unsigned int tests = 100;
54 std::tuple<std::string,McSvm,bool> machines[18] ={
75 std::printf(
"SHARK multi-class SVM example - training 18 machines:\n");
76 for (
int i=0; i<18; i++)
80 trainer.
train(svm, training);
82 double train_error = loss.
eval(training.
labels(), output);
83 output = svm(test.
inputs());
84 double test_error = loss.
eval(test.
labels(), output);
86 std::cout<<std::get<0>(machines[i])<<(trainer.
trainOffset()?
" w bias ":
" w/o bias");
87 std::cout<<
"\ttraining error="<<train_error;
88 std::cout<<
"\ttest error="<<test_error;