Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from Jan 20, 2021

Conversation

angela97lin
Copy link
Contributor

@angela97lin angela97lin commented Jan 15, 2021

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
Copy link

codecov bot commented Jan 15, 2021

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.

Copy link
Collaborator

@chukarsten chukarsten left a comment

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.

Copy link
Contributor

@ParthivNaresh ParthivNaresh left a comment

Choose a reason for hiding this comment

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

Looks good!

Copy link
Contributor

@bchen1116 bchen1116 left a comment

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
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
2 checks passed
@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.

None yet

4 participants