Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix buffer dtype mismatch in isotonic regression #14902
Tested under :
A more realistic scenario is creating an XGBClassifier model (with
I am not good at Cython but I think the reason is by using
Error replay: ``` from sklearn import isotonic import numpy as np m = isotonic.IsotonicRegression() m.fit(np.zeros((10,),dtype='float32'), np.zeros((10,),dtype='int64')) ``` Gives ``` File "sklearn/_isotonic.pyx", line 66, in sklearn._isotonic._make_unique ValueError: Buffer dtype mismatch, expected 'float' but got 'double' ``` Tested under : `scikit-learn==0.21.3` `numpy==0.17.0`. A more realistic scenario is creating an XGBClassifier model (with xgboost==0.90), and run `sklearn.calibration.CalibratedClassifierCV` on it. The same error happens. I am not good at Cython but I think the reason is by using `check_array`, `X` and `y` get converted to different types. Here is a simple fix that make the code work, I think there should be a better way to fix it in Cython code.