Skip to content

feat(skore): Add params_search_reports_ as a list of CrossValidationReport#2125

Draft
glemaitre wants to merge 4 commits intoprobabl-ai:mainfrom
glemaitre:cv_results_report
Draft

feat(skore): Add params_search_reports_ as a list of CrossValidationReport#2125
glemaitre wants to merge 4 commits intoprobabl-ai:mainfrom
glemaitre:cv_results_report

Conversation

@glemaitre
Copy link
Member

@glemaitre glemaitre commented Nov 2, 2025

closes #2127

This PR is an exploration of what is required to store the results of hyperparmeters search done with a GridSearchCV or RandomizedSearchCV via a CrossValidationReport. Basically, we want to avoid to have to refit anything that already have been fitted with scikit-learn.

In short:

  • we need to monkey patch two scikit-learn components to force to store the estimators in cv_results_
  • we need two factories to create a ComparisonReport of CrossValidationReport from the cv_results_.

The benefit of building upon ComparisonReport and CrossValidationReport is that we already have the structure to just send those types of reports in the skore-hub.

TODO:

  • Need documentation in the user guide
  • Need a compelling example

Thoughts:

We should thing further regarding the type of comparison one tries to achieve when comparing results from an hyperparameter search and when comparing different model. Usually, hyperparameters search is related to have a single model and explore the parameter while comparing different models makes that there is nothing in common, potentially.

Therefore, the ComparisonReport could have a couple of functionality dedicated to hyper parameters search that could be activated when passing the results of a cross-validation search.

@glemaitre glemaitre marked this pull request as draft November 2, 2025 17:45
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

Documentation preview @ 5e3cd98

@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2025

Coverage

Coverage Report for skore/
FileStmtsMissCoverMissing
skore/src/skore
   __init__.py230100% 
   _config.py310100% 
   exceptions.py440%4, 15, 19, 23
skore/src/skore/_sklearn
   __init__.py60100% 
   _base.py1981492%45, 58, 127, 130, 183, 186–187, 189–192, 225, 228–229
   find_ml_task.py610100% 
   search_cv.py180100% 
   types.py27196%28
skore/src/skore/_sklearn/_comparison
   __init__.py70100% 
   feature_importance_accessor.py35294%88, 107
   metrics_accessor.py178398%173, 253, 1215
   report.py1070100% 
   utils.py540100% 
skore/src/skore/_sklearn/_cross_validation
   __init__.py90100% 
   data_accessor.py45393%134, 137, 140
   feature_importance_accessor.py240100% 
   metrics_accessor.py182199%244
   report.py154199%535
skore/src/skore/_sklearn/_estimator
   __init__.py90100% 
   data_accessor.py66198%82
   feature_importance_accessor.py168298%251–252
   metrics_accessor.py356897%200, 202, 209, 300, 369, 373, 388, 423
   report.py187597%246, 254–255, 522–523
skore/src/skore/_sklearn/_plot
   __init__.py30100% 
   base.py98693%61–62, 224–226, 230
   utils.py770100% 
skore/src/skore/_sklearn/_plot/data
   __init__.py20100% 
   table_report.py185199%706
skore/src/skore/_sklearn/_plot/metrics
   __init__.py60100% 
   confusion_matrix.py70494%92, 100, 122, 230
   feature_importance_display.py672168%88, 121–122, 124, 142–146, 148–155, 158–160, 162
   metrics_summary_display.py80100% 
   precision_recall_curve.py281598%455, 555, 559, 619, 751
   prediction_error.py227597%179, 186, 422, 505, 705
   roc_curve.py294897%387, 510, 515, 616, 621, 625, 694, 834
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.py19194%83
   high_class_imbalance_warning.py200100% 
   random_state_unset_warning.py100100% 
   shuffle_true_warning.py90100% 
   stratify_is_set_warning.py100100% 
   time_based_column_warning.py210100% 
   train_test_split_warning.py30100% 
skore/src/skore/_utils
   __init__.py6266%8, 13
   _accessor.py90396%34, 146, 190
   _environment.py27196%40
   _fixes.py80100% 
   _index.py50100% 
   _logger.py22481%15–17, 19
   _measure_time.py100100% 
   _parallel.py38392%23, 33, 124
   _patch.py39684%23, 25–26, 37, 39, 137
   _progress_bar.py460100% 
   _repr_html.py80100% 
   _show_versions.py380100% 
   _testing.py550100% 
skore/src/skore/project
   __init__.py20100% 
   project.py480100% 
   summary.py75198%120
   widget.py1870100% 
TOTAL412911697% 

Tests Skipped Failures Errors Time
1115 5 💤 0 ❌ 0 🔥 4m 33s ⏱️

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.

feat(skore): Store the results of SearchCV as a ComparisonReport of CrossValidationReport

1 participant