You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support max_bins > 255 in Hist-GBDT estimators and categorical features with high cardinality #26277
As originally sketched in #26268 (comment) there might be a way to enable support for arbitrary high values of max_bins for both categorical and numerical features. This may not be super critical for numerical features, but this would enable categorical features of arbitrary cardinality, which is desirable.
The rough idea is to internally map an input categorical feature into multiple binned features (probably num_categories // 255 + 1 features) and to update the Splitter and the predictors to treat that group of features as a single feature.
changed the title [-]Support `max_bins > 255` in Hist-GBDT estimators[/-][+]Support `max_bins > 255` in Hist-GBDT estimators and categorical features with high cardinality[/+]on Apr 24, 2023
Updating the underlying data-structure will lead to a different memory footprint, and likely different perf as well. Sounds more risky to me, but if you implement it and benchmark indicate no regression, then why not.
Updating the underlying data-structure will lead to a different memory footprint, and likely different perf as well. Sounds more risky to me, but if you implement it and benchmark indicate no regression, then why not.
In memory, the histograms look the same: a contiguous array of hist_struct. The only difference is that we currently might have quite some unused bins.
Activity
[-]Support `max_bins > 255` in Hist-GBDT estimators[/-][+]Support `max_bins > 255` in Hist-GBDT estimators and categorical features with high cardinality[/+]lorentzenchr commentedon Jan 22, 2024
The number of bins are hardcoded in:
An alternative to allow for more than 256 bins is therefore
NicolasHug commentedon Jan 23, 2024
Updating the underlying data-structure will lead to a different memory footprint, and likely different perf as well. Sounds more risky to me, but if you implement it and benchmark indicate no regression, then why not.
lorentzenchr commentedon Jan 23, 2024
In memory, the histograms look the same: a contiguous array of hist_struct. The only difference is that we currently might have quite some unused bins.
NicolasHug commentedon Jan 23, 2024
I'm was more thinking of
X_binnedrather than about the histograms.I assume that using a larger dtype is only going to worsen that problem? (Is that an actual pb in practice?)