Skip to content

feat(skore): Better grouping in the help menu of the metrics accessor#2838

Draft
glemaitre wants to merge 1 commit into
probabl-ai:mainfrom
glemaitre:help_metrics
Draft

feat(skore): Better grouping in the help menu of the metrics accessor#2838
glemaitre wants to merge 1 commit into
probabl-ai:mainfrom
glemaitre:help_metrics

Conversation

@glemaitre

@glemaitre glemaitre commented Apr 27, 2026

Copy link
Copy Markdown
Member

closes #2746

This PR improves the help of the metrics accessor by grouping the registry management methods, the metrics to be called, and the displays in to sub groups.

For the moment, we are hard coding them but if the metrics are dynamically generated, we could easily leverage the registry to populate the the registry methods and the metrics.

My initial thought is to have the following design:

image

@glemaitre glemaitre marked this pull request as draft April 27, 2026 21:54
@github-actions

Copy link
Copy Markdown
Contributor

Documentation preview @ 1f4ab30

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report for skore/
FileStmtsMissBranchBrPartCoverMissing
skore/src/skore
   __init__.py31020100% 
   _config.py58312194%71, 118–119
   exceptions.py44000%4, 15, 19, 23
skore/src/skore/_project
   __init__.py0000100% 
   _summary.py80138398%121
   _widget.py1910442100% 
   login.py1324184%65–66
   plugin.py12020100% 
   project.py54216396%131, 140
   types.py3000100% 
skore/src/skore/_sklearn
   __init__.py8000100% 
   _base.py70120098%44
   compare.py5000100% 
   evaluate.py440240100% 
   feature_names.py260120100% 
   find_ml_task.py610462100% 
   metrics.py3100701100% 
   types.py1610093%29
skore/src/skore/_sklearn/_comparison
   __init__.py7000100% 
   inspection_accessor.py2712096%347
   metrics_accessor.py123418496%272–273, 341, 1127
   report.py142752095%464, 501, 504, 510, 567–569
skore/src/skore/_sklearn/_cross_validation
   __init__.py9000100% 
   data_accessor.py36212294%48, 74
   inspection_accessor.py2712096%319
   metrics_accessor.py117316397%224–225, 1086
   report.py2011348793%69, 74, 79, 301, 515, 573, 595, 614, 617, 623, 706–708
skore/src/skore/_sklearn/_diagnostic
   __init__.py3000100% 
   base.py76524393%124–125, 165, 253–254
   model_checks.py116126199%172
   utils.py2316195%39
skore/src/skore/_sklearn/_estimator
   __init__.py9000100% 
   data_accessor.py48220195%61, 177
   inspection_accessor.py3718297%278
   metrics_accessor.py1270220100% 
   report.py33115941095%49, 63, 249, 322, 406, 655, 744, 747, 766, 768, 774–775, 859–861
skore/src/skore/_sklearn/_plot
   __init__.py3000100% 
   base.py61214196%61–62
   utils.py147366397%254–255, 434
skore/src/skore/_sklearn/_plot/data
   __init__.py2000100% 
   table_report.py177160199%670
skore/src/skore/_sklearn/_plot/inspection
   __init__.py0000100% 
   coefficients.py1810881100% 
   impurity_decrease.py103234398%423, 467
   permutation_importance.py198190199%585
   utils.py320100100% 
skore/src/skore/_sklearn/_plot/metrics
   __init__.py6000100% 
   confusion_matrix.py1850682100% 
   metrics_summary_display.py1330621100% 
   precision_recall_curve.py1130321100% 
   prediction_error.py1660542100% 
   roc_curve.py1190342100% 
skore/src/skore/_sklearn/train_test_split
   __init__.py2000100% 
   train_test_split.py710342100% 
skore/src/skore/_sklearn/train_test_split/warning
   __init__.py8000100% 
   high_class_imbalance_too_few_examples_warning.py1916194%83
   high_class_imbalance_warning.py20060100% 
   random_state_unset_warning.py10020100% 
   shuffle_true_warning.py9020100% 
   stratify_is_set_warning.py10020100% 
   time_based_column_warning.py21040100% 
   train_test_split_warning.py3000100% 
skore/src/skore/_utils
   __init__.py620066%8, 13
   _accessor.py10628301373%12–13, 15, 36, 61–65, 68, 70–71, 76, 81, 83, 85, 92–94, 120–121, 123–124, 126, 132, 164, 218, 238
   _cache.py37021100% 
   _cache_key.py35522585%22, 24, 51, 59, 68
   _callable_name.py9040100% 
   _dataframe.py43418490%27, 46, 48, 63
   _environment.py32110296%44
   _fixes.py8020100% 
   _index.py5020100% 
   _jupyter.py820075%13–14
   _logger.py2244081%15–17, 19
   _measure_time.py10000100% 
   _parallel.py17000100% 
   _patch.py21128842%30, 35–39, 42–43, 46–47, 58, 60
   _progress_bar.py4144090%55–56, 66–67
   _show_versions.py380120100% 
   _skrub.py4018197%77
   _testing.py1281412289%24, 33, 71–72, 94, 193, 202, 213–218, 220
skore/src/skore/_utils/repr
   __init__.py2000100% 
   base.py54040100% 
   data.py1470384100% 
   html_repr.py40000100% 
   rich_repr.py940344100% 
TOTAL5187157152211296% 

Tests Skipped Failures Errors Time
2157 5 💤 0 ❌ 0 🔥 5m 17s ⏱️

@GaetandeCast

Copy link
Copy Markdown
Collaborator

we could easily leverage the registry to populate the the registry methods and the metrics.

Then we can show the added custom metrics in the help tree which would be really cool imo

@auguste-probabl

Copy link
Copy Markdown
Collaborator

How does this close #2746?

@glemaitre

Copy link
Copy Markdown
Member Author

Because we are not going to remove the individual metrics but instead try to improve the documentation as an alternative.

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.

Simplify API by removing single metrics in favor of report.metrics.summarize

3 participants