-
Notifications
You must be signed in to change notification settings - Fork 876
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
Support for abstract cv method for StackingCVClassifier #203
Conversation
docs/sources/CHANGELOG.md
Outdated
@@ -26,6 +26,7 @@ The CHANGELOG for the current development version is available at | |||
- `plot_decision_regions` now supports plotting decision regions for more than 2 training features. (via [James Bourbeau](https://github.com/jrbourbeau)). | |||
- Parallel execution in `mlxtend.feature_selection.SequentialFeatureSelector` and `mlxtend.feature_selection.ExhaustiveFeatureSelector` is now performed over different feature subsets instead of the different cross-validation folds to better utilize machines with multiple processors if the number of features is large ([#193](https://github.com/rasbt/mlxtend/pull/193), via [@whalebot-helmsman](https://github.com/whalebot-helmsman)). | |||
- Raise meaningful error messages if pandas `DataFrame`s or Python lists of lists are fed into the StackingCVClassifer as a `fit` arguments. | |||
- The `StackingCVClassifier` can now accept any kind of cross validation technique by using `cv` argument. E.g. `StackingCVClassifier(..., cv=GroupKFold(n_splits=3))` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks nice, but could you mention that the n_folds
argument was changed to cv
? Maybe sth. like
- The
n_folds
parameter of theStackingCVClassifier
was changed tocv
and can now accept any kind of cross validation technique that is available from scikit-learn. For example,StackingCVClassifier(..., cv=StratifiedKFold(n_splits=3))
orStackingCVClassifier(..., cv=GroupKFold(n_splits=3))
(via Konstantinos Paliouras).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it looks better like this. Thanks
Thanks for the PR, the code looks fine, and that's a pretty elegant solution. Regarding the examples in the documentation (at https://github.com/rasbt/mlxtend/blob/master/docs/sources/user_guide/classifier/StackingCVClassifier.ipynb). Are you planning on changing the previous once to make sure they work with the API change? Also, it would prob. be a good idea to add a new example for |
I updated the CHANGELOG as you instructed but I would like to avoid updating the documentation because I am not familiar with the process. In case I am commiting more changes in the future, I will try to learn the process :) |
Thanks! For the documentation, you would just need to update the Jupyter Notebook text. However, I just see that the The general way would be to go into the
This would build a local API documentation via markdown, which is then simply read into the Jupyter notebook -- later, the Jupyter notebook gets converted into Markdown via
But don't worry about it, I will run Overall, it looks good now, I can merge it now unless you have additional suggestions |
Thank you for the info and I will keep them in mind for the next time :) I do not intend to make any more changes you can proceed with the merging |
Nice, I will merge it then! Thanks a lot for the contribution, I greatly appreciate it! |
Description
Change the API of
StackingCVClassifier
in order to accept any kind of cross-validation technique.Related issues or pull requests
Related #202
Pull Request requirements
./mlxtend/*/tests
directoriesnosetests ./mlxtend -sv
and make sure that all unit tests passnosetests ./mlxtend --with-coverage
flake8 ./mlxtend
./docs/sources/CHANGELOG.md
filemlxtend/docs/sources/
(optional)