-
Notifications
You must be signed in to change notification settings - Fork 412
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
DeprecationWarning with sklearn.GridSearchCV #76
Comments
Hi @MSardelich! Thanks for the heads up. I'd have to investigate why does this happen, and how to fix it. Do you have time to do this yourself and submit a PR to fix it? Hints: |
Hi @dukebody! Thanks for the prompt response. I see Altogether, IMHO it deserves a closer approach to the What is your take? |
From a brief read I understand this requirement is for the cloning happening in the cross-validation to work easily. You are right, we need to modify the way sklearn-pandas work for it to be compatible with |
@dukebody Unfortunately I don't feel confident enough to propose these structural changes. It seems to be relatively complex to change the way |
Paul is not actively contributing to the |
Hello i just wonder If this can be fixed, or there would be a usage workaround maybe? thanks |
It could be fixed, but requires a change in how skearn-pandas internally works. The dataframe mapper modifies the constructor parameters in the However checking the code around https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/base.py#L111 it looks like the scikit-learn I asked the sklearn maintainers in scikit-learn/scikit-learn#5540 (comment) for help. |
It looks like the issue here lies with the semantics of the
|
@wpm could you submit a PR to fix this issue? According to the sklearn mantainers explanation I understant that what we should do is defer the |
I have a similar problem, when using the decision tree classifier. mapper = DataFrameMapper(
[([col], StandardScaler()) for col in X.dtypes[X.dtypes != 'category'].index.tolist()] +
[([col], OneHotEncoder()) for col in X.dtypes[X.dtypes == 'category'].index.tolist()]
)
cross_val_score(make_pipeline(mapper, DecisionTreeClassifier()), X, Y) Warns: <cut>/lib/python3.6/site-packages/sklearn/base.py:122: DeprecationWarning: Estimator DataFrameMapper modifies parameters in __init__. This behavior is deprecated as of 0.18 and support for this behavior will be removed in 0.20.
% type(estimator).__name__, DeprecationWarning)
<cut>/lib/python3.6/site-packages/sklearn/base.py:122: DeprecationWarning: Estimator DataFrameMapper modifies parameters in __init__. This behavior is deprecated as of 0.18 and support for this behavior will be removed in 0.20.
% type(estimator).__name__, DeprecationWarning)
<cut>/lib/python3.6/site-packages/sklearn/base.py:122: DeprecationWarning: Estimator DataFrameMapper modifies parameters in __init__. This behavior is deprecated as of 0.18 and support for this behavior will be removed in 0.20.
% type(estimator).__name__, DeprecationWarning) |
Can someone take a look at my PR #105 ? |
@jimmywan Thanks a lot for your contribution! This is a much expected feature and I didn't have the energy to work on it myself. I commited a patch based on yours with some extra changes to deal with the |
Thanks for the efforts! Is the update already available on |
Yesssss! sklearn-pandas 1.5.0! https://pypi.python.org/pypi/sklearn-pandas Please try out and don't hesitate to report any bug or odd behavior! |
When using the library together with
sklearn.GridSearchCV
I am getting the deprecation warning below:/home/marcelo/.local/lib/python2.7/site-packages/sklearn/base.py:122: DeprecationWarning: Estimator DataFrameMapper modifies parameters in __init__. This behavior is deprecated as of 0.18 and support for this behavior will be removed in 0.20. % type(estimator).__name__, DeprecationWarning)
Since the behavior will change soon, I would check if it is something relevant to this library.
The text was updated successfully, but these errors were encountered: