-
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
Refactor StackingCVRegressor so that users can obtain meta_features #294
Conversation
Hello @takashioya! Thanks for updating the PR.
Comment last updated on December 01, 2017 at 07:02 Hours UTC |
Sadly, |
2762a64
to
d5b6f73
Compare
No worries, you can ignore those (and I can fix them another day). Usually, I say that making sure that any new code is "PEP8"-fine suffices :). Thanks for the PR, I will take a look at it now and provide my comments :) |
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.
The PR looks great so far. Here are just some minor suggestions
docs/sources/CHANGELOG.md
Outdated
@@ -15,6 +15,8 @@ The CHANGELOG for the current development version is available at | |||
##### New Features | |||
|
|||
- New `max_len` parameter for the frequent itemset generation via the `apriori` function to allow for early stopping. ([#270](https://github.com/rasbt/mlxtend/pull/270)) | |||
- New `store_train_meta_features` parameter for `fit` in StackingCVRegressor. if True, train meta-features are stored in `self.train_meta_features_`. | |||
New `pred_meta_features` method for StackingCVRegressor. People can get test meta-features using this method. ([#294](https://github.com/rasbt/mlxtend/pull/294)) |
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.
Unless you really don't like to be mentioned, you can add your name or GitHub handle here. E.g.,
New `pred_meta_features` method for StackingCVRegressor. People can get test meta-features using this method. ([#294](https://github.com/rasbt/mlxtend/pull/294) via [takashioya](https://github.com/takashioya))
@@ -66,10 +66,14 @@ class StackingCVRegressor(BaseEstimator, RegressorMixin, TransformerMixin): | |||
be shuffled at fitting stage prior to cross-validation. If the `cv` | |||
argument is a specific cross validation technique, this argument is | |||
omitted. | |||
store_train_meta_features : bool (default: False) | |||
If True, meta-features for training data is stored when you `fit` | |||
training data. You can get them by `self.train_meta_features_`. |
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 suggest a minor rephrasing to
store_train_meta_features : bool (default: False)
If True, the meta-features computed from the training data used for fitting the
meta-regressor stored in the `self.train_meta_features_` array, which can be
accessed after calling `fit`.
Could you also describe the shape/layout of the self.train_meta_features_
array?
@@ -163,6 +172,14 @@ def predict(self, X): | |||
else: | |||
return self.meta_regr_.predict(meta_features) | |||
|
|||
def predict_meta_features(self, X): |
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.
Here, it would be helpful to format it as a docstring so that it shows up in the API documentation. E.g., something similar to the fit
docstring. I just see that predict
, get_params
etc. don't have docstrings as well, but I can fix that later separately after this PR.
dc0a15b
to
61861dc
Compare
61861dc
to
154499e
Compare
Description
modify
fit
and add an attributeself.train_meta_features_
for obtaining train meta-features,and add a method
predict_meta_features
for obtaining test meta-features.Related issues or pull requests
#285
#290
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)