glum/monotonic-constraints-conflict
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| glum | error | none, edit by hand | All versions |
glum rejects combining monotonic_constraints with explicit A_ineq/b_ineq matrices or with L1 regularization (l1_ratio > 0), raising ValueError during fit.
glm = GeneralizedLinearRegressor(formula="x1 + x2", monotonic_constraints={"x1": "increasing"}, l1_ratio=0.5)glm = GeneralizedLinearRegressor(formula="x1 + x2", monotonic_constraints={"x1": "increasing"}, l1_ratio=0)What the rule reports
Section titled “What the rule reports”Calls to GeneralizedLinearRegressor or GeneralizedLinearRegressorCV that pass monotonic_constraints together with A_ineq/b_ineq or a positive literal l1_ratio.
How to fix it
Section titled “How to fix it”Use pure L2 regularization (l1_ratio=0) with monotonic_constraints, and do not mix monotonic_constraints with manual A_ineq/b_ineq matrices.
Diagnostic message
Section titled “Diagnostic message”monotonic_constraints cannot be combined with explicit A_ineq/b_ineq in glum and raises ValueError during fit. Use either monotonic_constraints or A_ineq/b_ineq.See all rules in the glum pack.