Skip to content

Update CatBoost estimators to return self in fit rather than underlying model for consistency#1701

Merged
angela97lin merged 7 commits into
mainfrom
ange_update_catboost_return
Jan 20, 2021
Merged

Update CatBoost estimators to return self in fit rather than underlying model for consistency#1701
angela97lin merged 7 commits into
mainfrom
ange_update_catboost_return

Conversation

@angela97lin

@angela97lin angela97lin commented Jan 15, 2021

Copy link
Copy Markdown
Contributor

Updates CatBoost estimators to return self in fit rather than underlying model for consistency. Our other estimators return self, catboost should too.

This fell out of work I've been doing w/ components and pipelines returning Woodwork and general cleanup of EvalML 😛

@codecov

codecov Bot commented Jan 15, 2021

Copy link
Copy Markdown

Codecov Report

Merging #1701 (a27d4a1) into main (51cba3f) will increase coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             main    #1701     +/-   ##
=========================================
+ Coverage   100.0%   100.0%   +0.1%     
=========================================
  Files         242      242             
  Lines       19055    19072     +17     
=========================================
+ Hits        19047    19064     +17     
  Misses          8        8             
Impacted Files Coverage Δ
...ents/estimators/classifiers/catboost_classifier.py 100.0% <100.0%> (ø)
...onents/estimators/regressors/catboost_regressor.py 100.0% <100.0%> (ø)
.../tests/component_tests/test_baseline_classifier.py 100.0% <100.0%> (ø)
...l/tests/component_tests/test_baseline_regressor.py 100.0% <100.0%> (ø)
.../tests/component_tests/test_catboost_classifier.py 100.0% <100.0%> (ø)
...l/tests/component_tests/test_catboost_regressor.py 100.0% <100.0%> (ø)
...s/component_tests/test_decision_tree_classifier.py 100.0% <100.0%> (ø)
...ts/component_tests/test_decision_tree_regressor.py 100.0% <100.0%> (ø)
evalml/tests/component_tests/test_en_classifier.py 100.0% <100.0%> (ø)
evalml/tests/component_tests/test_en_regressor.py 100.0% <100.0%> (ø)
... and 9 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 51cba3f...a27d4a1. Read the comment docs.

@chukarsten chukarsten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good. I was trying to see if we had any tests that locked down what an estimator child class returns for it's methods, and couldn't find any right off the bat. Shoot me a message on slack if that exists. I think it's important that we have some tests for these functions, like feature_importance() that I think need to return numpy arrays but we either don't check for it or test for it.

@ParthivNaresh ParthivNaresh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@bchen1116 bchen1116 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Nice catch!

@angela97lin

Copy link
Copy Markdown
Contributor Author

@chukarsten I think you're right in that our other tests don't explicitly check that, for example, the return type of fit is self. Feature importance is a little less obvious but I think in most cases we have test_feature_importance which checks using numpy's np.testing.assert_almost_equal method whether or not our feature importance method returns the same values as using the external library directly, for example. That check will yell if its not comparing two numpy arrays and therefore helps us check if the return value is the expected numpy array :d

@angela97lin angela97lin merged commit 1a7244d into main Jan 20, 2021
@angela97lin angela97lin deleted the ange_update_catboost_return branch January 20, 2021 05:13
@bchen1116 bchen1116 mentioned this pull request Jan 26, 2021
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.

4 participants