glum/monotonic-constraints-without-formula
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| glum | error | none, edit by hand | All versions |
glum resolves named monotonic_constraints through Formulaic design matrices and raises ValueError("monotonic_constraints requires a formula. Use A_ineq/b_ineq for matrix inputs.") when formula is omitted or None.
glm = GeneralizedLinearRegressor(monotonic_constraints={"age": "increasing"})glm = GeneralizedLinearRegressor(formula="age + income", monotonic_constraints={"age": "increasing"})What the rule reports
Section titled “What the rule reports”Calls to GeneralizedLinearRegressor or GeneralizedLinearRegressorCV passing a non-None monotonic_constraints without a non-None formula.
How to fix it
Section titled “How to fix it”Specify formula= alongside monotonic_constraints, or pass linear inequality matrices with A_ineq= and b_ineq= for numeric array inputs.
Diagnostic message
Section titled “Diagnostic message”monotonic_constraints requires formula= in glum and raises ValueError otherwise. Pass formula= or use A_ineq= and b_ineq= for matrix inputs.See all rules in the glum pack.