From: eaudex Date: Sun, 4 Oct 2009 04:42:33 +0000 (+0000) Subject: Set -B -1 as default (no bias term included) X-Git-Tag: v150~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdb121310685f4b1fa8303a1c9af7916a1a90dae;p=liblinear Set -B -1 as default (no bias term included) --- diff --git a/README b/README index 91aee51..8c3d3a1 100644 --- a/README +++ b/README @@ -114,7 +114,7 @@ options: -s 5 and 6 |f'(w)|_inf <= eps*min(pos,neg)/l*|f'(w0)|_inf, where f is the primal function (default 0.01) --B bias : if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default 1) +-B bias : if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default -1) -wi weight: weights adjust the parameter C of different classes (see README for details) -v n: n-fold cross validation mode -q : quiet mode (no outputs) diff --git a/matlab/train.c b/matlab/train.c index 56e325b..2a97feb 100644 --- a/matlab/train.c +++ b/matlab/train.c @@ -43,7 +43,7 @@ void exit_with_help() " -s 5 and 6\n" " |f'(w)|_inf <= eps*min(pos,neg)/l*|f'(w0)|_inf,\n" " where f is the primal function (default 0.01)\n" - "-B bias : if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default 1)\n" + "-B bias : if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default -1)\n" "-wi weight: weights adjust the parameter C of different classes (see README for details)\n" "-v n: n-fold cross validation mode\n" "-q : quiet mode (no outputs)\n" @@ -97,7 +97,7 @@ int parse_command_line(int nrhs, const mxArray *prhs[], char *model_file_name) param.weight = NULL; cross_validation_flag = 0; col_format_flag = 0; - bias = 1; + bias = -1; // train loaded only once under matlab if(liblinear_default_print_string == NULL) diff --git a/train.c b/train.c index cc16774..f3e37db 100644 --- a/train.c +++ b/train.c @@ -34,7 +34,7 @@ void exit_with_help() " -s 5 and 6\n" " |f'(w)|_inf <= eps*min(pos,neg)/l*|f'(w0)|_inf,\n" " where f is the primal function (default 0.01)\n" - "-B bias : if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default 1)\n" + "-B bias : if bias >= 0, instance x becomes [x; bias]; if < 0, no bias term added (default -1)\n" "-wi weight: weights adjust the parameter C of different classes (see README for details)\n" "-v n: n-fold cross validation mode\n" "-q : quiet mode (no outputs)\n" @@ -144,7 +144,7 @@ void parse_command_line(int argc, char **argv, char *input_file_name, char *mode param.weight_label = NULL; param.weight = NULL; flag_cross_validation = 0; - bias = 1; + bias = -1; // parse options for(i=1;i