How the final number of bins is defined?
Hi! I can see that there is a max_bins parameter, however, I can't figure out how the final number is defined. Could you explain it to me, please? Kind regards, V.
max_bins only applies to continuous features. Under the default 'quantile' binning, we attempt to discretize continuous features into bins with approximately equal numbers of samples. Generally, if you get significantly less bins than max_bins it means your feature doesn't have sufficient numbers of unique values to create that many bins. The quantile binning algorithm is a heuristic however, and there are edge cases where you can have sufficient numbers of unique values in your dataset, but you still get less than max_bins bins. If you use 'uniform' binning instead of 'quantile', you'll almost always get the same number of bins as your max_bins parameter since it just divides up the space between the max and min values for the feature, even if there are no samples within some of the bins.
-InterpretML team
First, thank you for the reply! So the final number of bins is a fixed number across all features (even if just one feature doesn't have sufficient numbers) or is it a per feature number?
max_bins is a single number that applies to all continuous features, but quantile binning is run on each feature independently and the number of bins you get from that varies across features depending on how many unique values each feature has and other considerations.
-InterpretML team