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’ll 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
Contributor

@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
@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