]> granicus.if.org Git - liblinear/commitdiff
linear.cpp (check_parameter): only check value of p if L2R_L2LOSS_SVR.
authorDavid Miguel Susano Pinto <carandraug+dev@gmail.com>
Tue, 14 Sep 2021 14:02:02 +0000 (15:02 +0100)
committerChih-Jen Lin <cjlin@csie.ntu.edu.tw>
Wed, 15 Sep 2021 01:44:32 +0000 (09:44 +0800)
The parameter `p` is only used by the L2R_L2LOSS_SVR solver so skip
checking its value unless using it.  This is important because it has
no default value meaning that we are effectively forcing the user to
set it even if they don't use it.

Signed-off-by: Chih-Jen Lin <cjlin@csie.ntu.edu.tw>
linear.cpp

index 2e44acef6db07a096d634072605a90cc1529ac9e..6708ae462900eea0bb949f1ecdcc27fedbea9dc1 100644 (file)
@@ -3712,7 +3712,7 @@ const char *check_parameter(const problem *prob, const parameter *param)
        if(param->C <= 0)
                return "C <= 0";
 
-       if(param->p < 0)
+       if(param->p < 0 && param->solver_type == L2R_L2LOSS_SVR)
                return "p < 0";
 
        if(prob->bias >= 0 && param->solver_type == ONECLASS_SVM)