-
Notifications
You must be signed in to change notification settings - Fork 101
refactor: Remove CrossValidationReport._MetricsAccessor
#1318
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
Conversation
e4ec574 to
a191cbb
Compare
Coverage Report for backend
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I would delay this refactoring once the ComparisonReport(reports={
"LR": CrossValidationReport(LogisticRegression(), X=X, y=y),
"GBDT": CrossValidationReport(HistGradientBoostingClassifier(), X=X, y=y),
})I want to know if we should have a Here, for the moment I find it weird that some child of |
948ffd0 to
2b6fbb2
Compare
a191cbb to
99a3530
Compare
|
Please delay this PR after the merge of #1309. |
1883b29 to
239c6db
Compare
a6f497c to
52f19c3
Compare
Trying to make `cross_validation._MetricsAccessor` inherit from `comparison._MetricsAccessor` fails because CrossValidationReport inherits from ComparisonReport, therefore it already has a `metrics` accessor registered, and pandas's `_register_accessor` refuses to register a new one with the same name. I could simply bypass it with `setattr`, but that's dirty.
52f19c3 to
6e4b387
Compare
6e4b387 to
6395ad4
Compare
|
#1512 makes it apparent that the two classes |
Since a
CrossValidationReportcan be considered a special case of aComparisonReport, this PR uses inheritance to avoid code duplication. Of note are the following design choices:ComparisonReportmetrics have theaggregateparameter in order to make them available toCrossValidationReport.ComparisonReportcan now accept just 1EstimatorReport, so that even if cross-validation is interrupted, the initialization succeeds.Todo: