Skip to content

Renames feature_importances and related methods to singular #883

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

Merged
merged 4 commits into from
Jun 25, 2020

Conversation

angela97lin
Copy link
Contributor

Closes #868

@angela97lin angela97lin self-assigned this Jun 25, 2020
@codecov
Copy link

codecov bot commented Jun 25, 2020

Codecov Report

Merging #883 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #883   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files         195      195           
  Lines        8505     8505           
=======================================
  Hits         8484     8484           
  Misses         21       21           
Impacted Files Coverage Δ
evalml/pipelines/__init__.py 100.00% <ø> (ø)
...ents/estimators/classifiers/baseline_classifier.py 100.00% <100.00%> (ø)
...ents/estimators/classifiers/catboost_classifier.py 100.00% <100.00%> (ø)
...ts/estimators/classifiers/elasticnet_classifier.py 100.00% <100.00%> (ø)
...ents/estimators/classifiers/logistic_regression.py 100.00% <100.00%> (ø)
...components/estimators/classifiers/rf_classifier.py 100.00% <100.00%> (ø)
...nents/estimators/classifiers/xgboost_classifier.py 100.00% <100.00%> (ø)
...valml/pipelines/components/estimators/estimator.py 100.00% <100.00%> (ø)
...onents/estimators/regressors/baseline_regressor.py 100.00% <100.00%> (ø)
...onents/estimators/regressors/catboost_regressor.py 100.00% <100.00%> (ø)
... and 30 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a27f6e1...ec8e814. Read the comment docs.

@angela97lin angela97lin marked this pull request as ready for review June 25, 2020 05:42
@angela97lin angela97lin requested a review from dsherry June 25, 2020 13:11
@@ -39,6 +41,7 @@ Changelog
**Breaking Changes**
* Pipelines' static ``component_graph`` field must contain either ``ComponentBase`` subclasses or ``str``, instead of ``ComponentBase`` subclass instances :pr:`850`
* Rename ``handle_component`` to ``handle_component_class``. Now standardizes to ``ComponentBase`` subclasses instead of ``ComponentBase`` subclass instances :pr:`850`
* Pipelines' and classifiers' `feature_importances` is renamed `feature_importance`, `graph_feature_importances` is renamed `graph_feature_importance` :pr:`883`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

def feature_importances(self):
"""Returns feature importances. Since baseline regressors do not use input features to calculate predictions, returns an array of zeroes.
def feature_importance(self):
"""Returns importance associated with each feature. Since baseline regressors do not use input features to calculate predictions, returns an array of zeroes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -29,5 +29,5 @@ def __init__(self, n_estimators=100, max_depth=6, n_jobs=-1, random_state=0, **k
random_state=random_state)

@property
def feature_importances(self):
def feature_importance(self):
return self._component_obj.feature_importances_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see xgboost many and sklearn models use "feature_importances_" and catboost uses "get_feature_importance". Funny to see the differences. I like our rename.

Copy link
Contributor

@dsherry dsherry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for jumping on this! 🚢

@angela97lin angela97lin merged commit 1740209 into master Jun 25, 2020
@angela97lin angela97lin deleted the 868_singular branch June 25, 2020 13:27
@angela97lin angela97lin mentioned this pull request Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename feature_importances and related methods to singular
2 participants