-
Notifications
You must be signed in to change notification settings - Fork 112
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
MondrianCP can't handle Pandas dataframe #526
Comments
I managed to resolve the sklearn issue when using the 'mondrian_numpy' strategy in the example above by using indices in the ColumnTransformer instead of column names:
I don't know if the package maintainers still want the MondrianCP class to handle Pandas dataframes? Otherwise this issue can be closed. |
Hi @lennartvandeguchte, thank you for reporting this. Good to know you found a workaround. We need further internal discussion to decide what to do about this. We'll let you know. Best, |
Following our discussion: support for Pandas dataframes is something we'd like to have, but is not a quick win. Indeed, in a prefit setting, it is easy to address, but in a split or cross setting, we call .fit on the provided estimator (that can be a pipeline), and so we need to avoid casting X,y to NDArray otherwise we're losing some pd.Dataframe functionalities that can be required by the pipeline. We're adding this to our backlog. Note: see |
Describe the bug
When using the new MondrianCP class I'm unable to fit my estimator with a Pandas dataframe, while using the standard MapieRegressor this works fine. Since I'm using a sklearn pipeline that contains some column transformers that use the pandas column name, I can't transform my data into a numpy array first because then sklearn gives me an error when fitting the estimator.
To Reproduce
Below the code to reproduce my problem.
By changing the strategy to mondrian_numpy you can also reproduce the sklearn error I receive.
Expected behavior
Be able to use a Pandas dataframe as input data for MondrianCP class.
The text was updated successfully, but these errors were encountered: