-
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
Add random_state parameter to stacking cv estimators #523
Conversation
Great point. I think this is a relatively new feature and I didn't know it would work. While this is certainly great, one little request though,
Can we change that to |
@@ -115,7 +115,7 @@ class StackingCVRegressor(_BaseXComposition, RegressorMixin, TransformerMixin): | |||
def __init__(self, regressors, meta_regressor, cv=5, | |||
shuffle=True, random_state=0, verbose=0, | |||
refit=True, use_features_in_secondary=False, | |||
store_train_meta_features=False, n_jobs=1, | |||
store_train_meta_features=False, n_jobs=None, |
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 actually meant the random_state
to be random_state=None
, but good that you caught the n_jobs=None
thing as well (which is another sklearn convention)
The |
I see. I think |
I agree. Updated. |
That's great, happy to merge this. Thanks a lot! |
Description
The idea just came to my mind today. Since the latest
check_cv
from scikit-learn supportsrandom_state
, stacking CV estimators can have the parameter now.Related issues or pull requests
Pull Request Checklist
./docs/sources/CHANGELOG.md
file (if applicable)./mlxtend/*/tests
directories (if applicable)mlxtend/docs/sources/
(if applicable)nosetests ./mlxtend -sv
and 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