Skip to content

Conversation

@Muhammad-Rebaal
Copy link
Contributor

@Muhammad-Rebaal Muhammad-Rebaal commented Jun 14, 2025

Closes #1760

Hi @MarieSacksick , @glemaitre !

  1. I've renamed estimator_reports_ to reports_ throughout the CrossValidationReport class, aligning the API with ComparisonReport.

  2. Solved the pickling error by introducing allow_nested = False inside in progress_decorator of function _compute_metric_scores in metrics_acessor.py and allow_nested = True in _progress_bar.py .

  3. Add the requested unittest in test_progress_bar.py .

If I missed something kindly let me know

Thank You !

@github-actions
Copy link
Contributor

github-actions bot commented Jun 16, 2025

Coverage

Coverage Report for skore/
FileStmtsMissCoverMissing
skore/src/skore
   __init__.py230100% 
   _config.py280100% 
   exceptions.py440%4, 15, 19, 23
skore/src/skore/project
   __init__.py20100% 
   project.py480100% 
   summary.py740100% 
   widget.py138596%375–377, 447–448
skore/src/skore/sklearn
   __init__.py70100% 
   _base.py1971492%45, 58, 126, 129, 182, 185–186, 188–191, 224, 227–228
   find_estimators.py270100% 
   find_ml_task.py610100% 
   types.py26196%26
skore/src/skore/sklearn/_comparison
   __init__.py50100% 
   metrics_accessor.py178398%167, 247, 1239
   report.py1050100% 
   utils.py540100% 
skore/src/skore/sklearn/_cross_validation
   __init__.py50100% 
   metrics_accessor.py182199%241
   report.py122199%464
skore/src/skore/sklearn/_estimator
   __init__.py70100% 
   feature_importance_accessor.py143298%216–217
   metrics_accessor.py356897%190, 192, 199, 290, 359, 363, 378, 413
   report.py164298%438–439
skore/src/skore/sklearn/_plot
   __init__.py20100% 
   base.py50100% 
   style.py290100% 
   utils.py118595%50, 74–76, 80
skore/src/skore/sklearn/_plot/metrics
   __init__.py60100% 
   confusion_matrix.py69494%90, 98, 120, 228
   metrics_summary_display.py90100% 
   precision_recall_curve.py260598%459, 559, 563, 623, 743
   prediction_error.py215597%179, 186, 422, 505, 685
   roc_curve.py272897%386, 509, 514, 617, 622, 626, 697, 819
skore/src/skore/sklearn/train_test_split
   __init__.py00100% 
   train_test_split.py580100% 
skore/src/skore/sklearn/train_test_split/warning
   __init__.py80100% 
   high_class_imbalance_too_few_examples_warning.py16193%79
   high_class_imbalance_warning.py170100% 
   random_state_unset_warning.py100100% 
   shuffle_true_warning.py9188%44
   stratify_is_set_warning.py100100% 
   time_based_column_warning.py21195%73
   train_test_split_warning.py30100% 
skore/src/skore/utils
   __init__.py6266%8, 13
   _accessor.py53296%68, 109
   _environment.py270100% 
   _fixes.py80100% 
   _index.py50100% 
   _logger.py22481%15–17, 19
   _measure_time.py100100% 
   _parallel.py38392%23, 33, 124
   _patch.py13561%21, 23–24, 35, 37
   _progress_bar.py460100% 
   _show_versions.py33293%65–66
   _testing.py460100% 
TOTAL34008997% 

Tests Skipped Failures Errors Time
874 5 💤 0 ❌ 0 🔥 7m 1s ⏱️

@github-actions
Copy link
Contributor

github-actions bot commented Jun 16, 2025

Documentation preview @ 49b7818

Copy link
Contributor

@MarieSacksick MarieSacksick left a comment

Choose a reason for hiding this comment

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

Mostly ok for me, just one addition I don't understand.

y_pred=y_pred,
report_type="comparison-estimator",
estimators=[report.estimator_ for report in self._parent.reports_],
estimator_names=self._parent.report_names_,
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't output estimator names but the cross validation report names if given when building the - can you remove this line please?

This is already handled, if you check this code:

# %%
from sklearn.datasets import make_classification
from sklearn.ensemble import HistGradientBoostingClassifier
from skore import ComparisonReport, CrossValidationReport

# %%
X, y = make_classification(n_samples=1000, n_features=20, random_state=42)

# %%
cv_rep1 = CrossValidationReport(
    HistGradientBoostingClassifier(),
    X,
    y,
)
# %%
cv_rep2 = CrossValidationReport(
    HistGradientBoostingClassifier(learning_rate=1),
    X,
    y,
)
# %%
comp_named = ComparisonReport(
    {"cv_1": cv_rep1, "cv_2": cv_rep2},
)
# %%
comp_named.metrics.roc().plot()

for estimator_report in report.estimator_reports_
for estimator_report in report.reports_
],
estimator_names=self._parent.report_names_,
Copy link
Contributor

Choose a reason for hiding this comment

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

just like above, can you remove this line please?

*,
report_type: ReportType,
estimators: Sequence[BaseEstimator],
estimator_names: list[str],
Copy link
Contributor

Choose a reason for hiding this comment

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

why do you need this new parameter in this function? I don't see where it's used.

@auguste-probabl
Copy link
Contributor

Some conflicts need to be solved here.

@auguste-probabl
Copy link
Contributor

Superseded by #2033

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.

api(skoire): Rename estimator_reports_ in CrossValidationReport

3 participants