Skip to content

feat(skore): Add select_k and sorting_order to mdi and permutation displays#2591

Open
GaetandeCast wants to merge 3 commits intoprobabl-ai:mainfrom
GaetandeCast:select_k_permut
Open

feat(skore): Add select_k and sorting_order to mdi and permutation displays#2591
GaetandeCast wants to merge 3 commits intoprobabl-ai:mainfrom
GaetandeCast:select_k_permut

Conversation

@GaetandeCast
Copy link
Collaborator

@GaetandeCast GaetandeCast commented Mar 13, 2026

Closes #2473 and closes #2474.
This PR adds the select_k and sorting_order parameters to the frame and plot methods of the PermutationImportanceDisplay and ImpurityDecreaseDisplay, based on what already exists for the CoefficientsDisplay. It also raises a new error when select_k=0 for the plot to fail gracefully.

Contribution checklist

  • Unit tests were added or updated
  • The code passes our style conventions
  • All the tests pass
  • The documentation builds and renders properly
  • A new changelog entry was added to CHANGELOG.rst
  • All the commits in the PR are signed
  • The pull request title respects the Conventional Commits convention

AI usage disclosure

AI tools were involved for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test generation
  • Documentation (including examples)
  • Research and understanding

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Documentation preview @ 9a84460

@github-actions
Copy link
Contributor

github-actions bot commented Mar 13, 2026

Coverage

Coverage Report for skore/
FileStmtsMissCoverMissing
skore/src/skore
   __init__.py280100% 
   _config.py44197%57
   exceptions.py440%4, 15, 19, 23
skore/src/skore/_project
   __init__.py00100% 
   _summary.py80198%121
   _widget.py1950100% 
   login.py13284%65–66
   plugin.py120100% 
   project.py54296%153, 162
   types.py30100% 
skore/src/skore/_sklearn
   __init__.py70100% 
   _base.py58886%227–234
   evaluate.py27196%133
   feature_names.py260100% 
   find_ml_task.py610100% 
   types.py28196%30
skore/src/skore/_sklearn/_comparison
   __init__.py70100% 
   inspection_accessor.py34197%394
   metrics_accessor.py131298%247, 909
   report.py111397%497, 500, 506
skore/src/skore/_sklearn/_cross_validation
   __init__.py90100% 
   data_accessor.py31196%48
   inspection_accessor.py34197%373
   metrics_accessor.py115199%849
   report.py103496%406, 441, 444, 450
skore/src/skore/_sklearn/_estimator
   __init__.py90100% 
   data_accessor.py45197%167
   inspection_accessor.py340100% 
   metrics_accessor.py259299%311, 1144
   report.py142298%428, 431
skore/src/skore/_sklearn/_plot
   __init__.py30100% 
   base.py59296%60–61
   utils.py121298%273–274
skore/src/skore/_sklearn/_plot/data
   __init__.py20100% 
   table_report.py176199%665
skore/src/skore/_sklearn/_plot/inspection
   __init__.py00100% 
   coefficients.py1780100% 
   impurity_decrease.py100298%435, 479
   permutation_importance.py197199%591
   utils.py320100% 
skore/src/skore/_sklearn/_plot/metrics
   __init__.py60100% 
   confusion_matrix.py1640100% 
   metrics_summary_display.py990100% 
   precision_recall_curve.py1080100% 
   prediction_error.py1720100% 
   roc_curve.py1120100% 
skore/src/skore/_sklearn/train_test_split
   __init__.py20100% 
   train_test_split.py710100% 
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.py118496%38, 212, 266, 286
   _cache.py370100% 
   _cache_key.py29389%35, 43, 52
   _dataframe.py37197%56
   _environment.py32293%41, 44
   _fixes.py80100% 
   _index.py50100% 
   _jupyter.py8275%13–14
   _logger.py22481%15–17, 19
   _measure_time.py100100% 
   _parallel.py170100% 
   _patch.py211242%30, 35–39, 42–43, 46–47, 58, 60
   _progress_bar.py41490%55–56, 66–67
   _show_versions.py380100% 
   _testing.py1101190%21, 30, 158, 167, 178–183, 185
skore/src/skore/_utils/repr
   __init__.py20100% 
   base.py540100% 
   data.py1640100% 
   html_repr.py380100% 
   rich_repr.py810100% 
TOTAL42849297% 

Tests Skipped Failures Errors Time
2046 5 💤 0 ❌ 0 🔥 8m 12s ⏱️

@GaetandeCast GaetandeCast marked this pull request as ready for review March 13, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant