-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmain.cpp
More file actions
executable file
·50 lines (39 loc) · 1.07 KB
/
main.cpp
File metadata and controls
executable file
·50 lines (39 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
*******************************************************************************
*
* Copyright (c) 2015 Baidu.com, Inc. All Rights Reserved
*
*******************************************************************************
*
* @file: main.cpp
* @author: mazefeng(mazefeng01@baidu.com)
* @date: 2015/06/30 11:10:00
*
*/
#include "svm_common.h"
#include "svm_option.h"
#include "svm_solver.h"
const int RET_OK = 0;
const int RET_SVM_OPTION_ERR = 1;
const int RET_SVM_SOLVER_ERR = 2;
using std::cerr;
using std::endl;
void help(){
cerr << "Usage: light-svm -train ${train} -model ${model} "
<< "-valid ${valid} [-linear_kernel] [-C ${cost}] "
<< "[-epsilon ${eps}] [-sigma ${sig}] [-help]"
<< endl;
}
int main(int argc, char *argv[]){
int ret = RET_OK;
SVMOption *option = new SVMOption();
ret = option->parse_command_line(argc, argv);
if (ret != 0){
help();
return RET_SVM_OPTION_ERR;
}
option->print();
SVMSolver *solver = new SVMSolver(option);
solver->train();
solver->predict();
}