Open
Description
Description
Training crashes when "monotone_constraints_method"
is set to "advanced"
and at least one feature is categorical but "monotone_constraints"
is not defined.
The crash is fixed by setting "monotone_constraints"
, but according to the documentation "monotone_constraints_method"
should not be used unless "monotone_constraints"
is set.
Reproducible example
import lightgbm as lgb
import numpy as np
import pandas as pd
size = 60
df = pd.DataFrame(
{
"x": np.random.uniform(size=size),
"c": pd.Categorical(np.random.choice([0, 1, 2], size=size, replace=True)),
"y": np.random.uniform(size=size),
}
)
lgb.train(
{
"monotone_constraints_method": "advanced",
# "monotone_constraints": "0,0",
},
lgb.Dataset(df[["x", "c"]], df["y"], categorical_feature="auto"),
)
Environment info
LightGBM version or commit hash: '4.6.0'
Command(s) you used to install LightGBM
poetry add lightgbm