linear_csvm.cpp
Go to the documentation of this file.
4 
5 #include <shark/Core/Timer.h>
6 #include <iostream>
7 using namespace shark;
8 using namespace std;
9 
10 int main(int argc, char **argv) {
12  importSparseData(data_sparse, "rcv1_train.binary",0,8192);
13 
14  for(double C = 1; C <= 100000; C*=10){
17 
18  Timer time;
19  trainer.train(model, data_sparse);
20  double time_taken = time.stop();
21 
22  ZeroOneLoss<> loss;
23  cout << C <<" " << time_taken <<" "<< loss(data_sparse.labels(),model(data_sparse.inputs()))<<std::endl;
24  }
25 }