-
Notifications
You must be signed in to change notification settings - Fork 888
Make StackingCVRegressor capable of replacing regressors in GridSearchCV #515
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
Conversation
|
@rasbt If you like this PR, I can add a test for the regressor replacement. |
|
Thanks a lot, I really like this PR. I think the naming change is in the worst case a bit unfortunate, but not a big deal, because it's a substantial improvement overall.
that would be great! Also, we may have to clean up the documentation a little bit (the documentation files are in https://github.com/rasbt/mlxtend/tree/master/docs/sources/user_guide from which the HTML docs are auto-generated upon version updates) I think this will allow us to have much better compatibility with GridSearchCV like you mentioned -- there were a couple of questions about this in the past. (Probably related to #511) Also, but this would be a bit of extra work as we haven't finished the refactoring, it would be nice to bring this to the other stacking classes as well (StackingClassifier, StackingCVClassifier, and StackingRegressor). |
|
Thanks, @rasbt. I'll make a test and update the documentation file, but my work for this PR, probably, will be limited to |
No worries, Rome wasn't built in one day, I will add it to the "Issues" to do list :)
Good catch, yeah, I think there are lot of these things where using more of scikit-learn's paradigms would be useful to mitigate these issues. |
|
@rasbt Finally, I make a base utility which could be applied to other stacking estimators. Also, ordered parameter replacement seems to be possible now. |
|
Thanks a lot, this is great! Only made a few minor tweaks and looking forward to merging once the tests pass. |
|
haha, typo. |
|
Oh, didn't catch that one, thanks again! |
Description
Current
named_regressorsand the fitting regressors are disconnected. When replacing the one of regressors, either base or meta, in GridSearchCV, the functioning regressors remain unchanged.The nice naming of the
meta_regressoris lost after this PR, but it seems sklearn processes many single estimator parameters in such way.After this PR, all keys in the
get_paramsare able toset_paramsand functional in SearchCV.Related issues or pull requests
Pull Request Checklist
./docs/sources/CHANGELOG.mdfile (if applicable)./mlxtend/*/testsdirectories (if applicable)mlxtend/docs/sources/(if applicable)nosetests ./mlxtend -svand make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g.,nosetests ./mlxtend/classifier/tests/test_stacking_cv_classifier.py -sv)flake8 ./mlxtend