-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement CrossFitEstimator.score
#63
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #63 +/- ##
==========================================
+ Coverage 94.99% 95.00% +0.01%
==========================================
Files 15 15
Lines 1498 1503 +5
==========================================
+ Hits 1423 1428 +5
Misses 75 75 ☔ View full report in Codecov by Sentry. |
y, self.predict(X, is_oos, oos_method), sample_weight=sample_weight | ||
) | ||
elif self._estimator_type == "regressor": | ||
return r2_score( |
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.
Any particular reason why you chose R2, rather than e.g. the RMSE?
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.
metalearners/cross_fit_estimator.py
Outdated
) -> float: | ||
"""Return the coefficient of determination of the prediction if the estimator is | ||
a regressor or the mean accuracy if it is a classifier.""" | ||
if self._estimator_type == "classifier": |
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.
Do you happen to know what the trade-off between doing this and using sklearn
's is_classifier
is here?
E.g.
if is_classifier(self): |
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.
None, I just didn't think about it 😅 . I think it's better to use the sklearn
methods.
108f4f3
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.
Thanks :)
This PR is just for the sake of completeness.
Checklist
CHANGELOG.rst
entry