kernel_csvm.cpp
Go to the documentation of this file.
5 
6 #include <shark/Core/Timer.h>
7 #include <iostream>
8 using namespace shark;
9 using namespace std;
10 
11 int main(int argc, char **argv) {
13  importSparseData(data, "cod-rna",0,8192);
14 
15  GaussianRbfKernel<> kernel(1.0);
16  for(double C = 0.01; C <= 1; C*=10){
18  CSvmTrainer<RealVector> trainer(&kernel,C, true);
19 
20  Timer time;
21  trainer.train(model, data);
22  double time_taken = time.stop();
23 
24  ZeroOneLoss<> loss;
25  cout << C <<" " << time_taken <<" "<< loss(data.labels(),model(data.inputs()))<<std::endl;
26  }
27 }