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
KBinsDiscretizer with strategy='quantile fails in certain situations with an exception. It happens when multiple percentiles returned from numpy are expected to be identical but show numerical instability and render bin_edges non-monotonic, which is fatal for np.digitize. This is probably related to numpy/numpy#10373
This could be an option if #12774 will be solved by removing empty bins in every case. I'm not sure if this should be optional behaviour or not. I stumbled upon some strange edge cases when trying to do that similar to #13165, but better discuss it there.
I've tested this on QuantileTransformer with the toy data from above. Resulting quantiles_ are indeed monotonic with n_quantiles=11, but the transform method seems to handle it well anyway and gives the expected result.
Description
KBinsDiscretizer
withstrategy='quantile
fails in certain situations with an exception. It happens when multiple percentiles returned from numpy are expected to be identical but show numerical instability and render bin_edges non-monotonic, which is fatal for np.digitize. This is probably related to numpy/numpy#10373Steps/Code to Reproduce
The example is a bit contrived (3 values and 10 bins), but isolates the problem well enough.
Expected Results
No error is thrown. Robust handling of close percentiles.
Actual Results
Versions
The text was updated successfully, but these errors were encountered: