-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
CalibratedClassifierCV doesn't work with set_config(transform_output="pandas")
#25499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I can reproduce it. We need to investigate but I would expect the inner estimator not being able to handle some dataframe because we expected NumPy arrays before. |
This could be a bit like #25370 where things get confused when pandas output is configured. I think the solution is different (TSNE's PCA is truely "internal only") but it seems like there might be something more general to investigate/think about related to pandas output and nested estimators. |
There is something quite smelly regarding the interaction between It seems that we output a pandas Series when calling |
OK the reason is that |
I don't know if we should have: def predict(self, T):
with config_context(transform_output="default"):
return self.transform(T) or def predict(self, T):
return np.array(self.transform(T), copy=False).squeeze() |
Another solution would be to have a private |
/take |
Describe the bug
CalibratedClassifierCV with isotonic regression doesn't work when we previously set
set_config(transform_output="pandas")
.The IsotonicRegression seems to return a dataframe, which is a problem for
_CalibratedClassifier
inpredict_proba
where it tries to put the dataframe in a numpy array rowproba[:, class_idx] = calibrator.predict(this_pred)
.Steps/Code to Reproduce
Expected Results
It should not crash.
Actual Results
Versions
The text was updated successfully, but these errors were encountered: