From: eaudex Date: Mon, 24 Aug 2009 02:33:25 +0000 (+0000) Subject: modify solver_type in train.c predict.c X-Git-Tag: v140~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc0f93ff5afdf7a89069383a8f632047f63504bc;p=liblinear modify solver_type in train.c predict.c L2_LR => L2R_LR L2_L2LOSS_SVC_DUAL => L2R_L2LOSS_SVC_DUAL L2_L2LOSS_SVC => L2R_L2LOSS_SVC L2_L1LOSS_SVC_DUAL => L2R_L1LOSS_SVC_DUAL L1_L2LOSS_SVC => L1R_L2LOSS_SVC L1_LR => L1R_LR --- diff --git a/matlab/predict.c b/matlab/predict.c index 7bd9027..0d79afa 100644 --- a/matlab/predict.c +++ b/matlab/predict.c @@ -272,7 +272,7 @@ void mexFunction( int nlhs, mxArray *plhs[], if(prob_estimate_flag) { - if(model_->param.solver_type!=L2_LR) + if(model_->param.solver_type!=L2R_LR) { mexPrintf("probability output is only supported for logistic regression\n"); prob_estimate_flag=0; diff --git a/matlab/train.c b/matlab/train.c index f8ad784..56e325b 100644 --- a/matlab/train.c +++ b/matlab/train.c @@ -89,7 +89,7 @@ int parse_command_line(int nrhs, const mxArray *prhs[], char *model_file_name) char *argv[CMD_LEN/2]; // default values - param.solver_type = L2_L2LOSS_SVC_DUAL; + param.solver_type = L2R_L2LOSS_SVC_DUAL; param.C = 1; param.eps = INF; // see setting below param.nr_weight = 0; @@ -173,11 +173,11 @@ int parse_command_line(int nrhs, const mxArray *prhs[], char *model_file_name) if(param.eps == INF) { - if(param.solver_type == L2_LR || param.solver_type == L2_L2LOSS_SVC) + if(param.solver_type == L2R_LR || param.solver_type == L2R_L2LOSS_SVC) param.eps = 0.01; - else if(param.solver_type == L2_L2LOSS_SVC_DUAL || param.solver_type == L2_L1LOSS_SVC_DUAL || param.solver_type == MCSVM_CS) + else if(param.solver_type == L2R_L2LOSS_SVC_DUAL || param.solver_type == L2R_L1LOSS_SVC_DUAL || param.solver_type == MCSVM_CS) param.eps = 0.1; - else if(param.solver_type == L1_L2LOSS_SVC || param.solver_type == L1_LR) + else if(param.solver_type == L1R_L2LOSS_SVC || param.solver_type == L1R_LR) param.eps = 0.01; } return 0;