From 13d4a25803d1562a75cafb22fc760f9fbd731c17 Mon Sep 17 00:00:00 2001 From: David Miguel Susano Pinto Date: Tue, 14 Sep 2021 15:02:02 +0100 Subject: [PATCH] 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 --- linear.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.50.1