From: David Miguel Susano Pinto Date: Tue, 14 Sep 2021 14:02:02 +0000 (+0100) Subject: linear.cpp (check_parameter): only check value of p if L2R_L2LOSS_SVR. X-Git-Tag: v244~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13d4a25803d1562a75cafb22fc760f9fbd731c17;p=liblinear linear.cpp (check_parameter): only check value of p if L2R_L2LOSS_SVR. 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 --- diff --git a/linear.cpp b/linear.cpp index 2e44ace..6708ae4 100644 --- a/linear.cpp +++ b/linear.cpp @@ -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)