Skip to content

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"})

Calls to GeneralizedLinearRegressor or GeneralizedLinearRegressorCV passing a non-None monotonic_constraints without a non-None formula.

Specify formula= alongside monotonic_constraints, or pass linear inequality matrices with A_ineq= and b_ineq= for numeric array inputs.

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.