Skip to content

refactor: Disambiguate the different (_?)estimator(_?) attributes#2907

Merged
glemaitre merged 2 commits into
probabl-ai:mainfrom
auguste-probabl:rename-_estimator
May 21, 2026
Merged

refactor: Disambiguate the different (_?)estimator(_?) attributes#2907
glemaitre merged 2 commits into
probabl-ai:mainfrom
auguste-probabl:rename-_estimator

Conversation

@auguste-probabl
Copy link
Copy Markdown
Collaborator

@auguste-probabl auguste-probabl commented May 13, 2026

  • estimator becomes the original estimator passed at initialization
  • estimator_ becomes the fitted estimator (following sklearn convention); has the same type as estimator
  • _estimator becomes learner_, the estimator wrapped in a SkrubLearner-compatible interface (used internally)

AI usage disclosure

AI tools were involved for:
Nothing

@auguste-probabl auguste-probabl changed the title refactor: Rename EstimatorReport._estimator to EstimatorReport.learner_ refactor: Rename EstimatorReport._estimator to EstimatorReport.learner_ May 13, 2026
@auguste-probabl auguste-probabl changed the title refactor: Rename EstimatorReport._estimator to EstimatorReport.learner_ refactor: Disambiguate the different (_?)estimator(_?) attributes May 13, 2026
@auguste-probabl auguste-probabl force-pushed the rename-_estimator branch 2 times, most recently from b32e9fa to 527e4c0 Compare May 18, 2026 08:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Coverage

Coverage Report for skore/
FileStmtsMissBranchBrPartCoverMissing
skore/src/skore
   __init__.py3922094%112–113
   _config.py58312194%71, 118–119
   exceptions.py44000%4, 15, 19, 23
skore/src/skore/_plugins
   __init__.py12000100% 
skore/src/skore/_plugins/hub
   __init__.py920077%15, 20
   exception.py2000100% 
   json.py1012190%16
skore/src/skore/_plugins/hub/artifact
   __init__.py0000100% 
   artifact.py23040100% 
   serializer.py27020100% 
   upload.py26040100% 
skore/src/skore/_plugins/hub/artifact/media
   __init__.py5000100% 
   data.py20000100% 
   inspection.py721020886%46–49, 51, 53, 60, 62, 68, 107
   media.py10000100% 
   model.py10000100% 
   performance.py10618199%43
skore/src/skore/_plugins/hub/artifact/pickle
   __init__.py2000100% 
   pickle.py24020100% 
skore/src/skore/_plugins/hub/authentication
   __init__.py0000100% 
   apikey.py7000100% 
   login.py2844285%37, 42–43, 52
   token.py80080100% 
   uri.py6000100% 
skore/src/skore/_plugins/hub/client
   __init__.py0000100% 
   client.py881018388%140, 187–189, 191–192, 194, 196, 198, 230
skore/src/skore/_plugins/hub/metric
   __init__.py10000100% 
   accuracy.py35000100% 
   brier_score.py35000100% 
   log_loss.py35000100% 
   metric.py5542192%38, 77–78, 84
   precision.py57000100% 
   r2.py35000100% 
   recall.py59000100% 
   rmse.py35000100% 
   roc_auc.py35000100% 
   timing.py7640094%45–46, 104–105
skore/src/skore/_plugins/hub/project
   __init__.py0000100% 
   project.py138626595%84, 109, 124, 323, 403, 433
skore/src/skore/_plugins/hub/report
   __init__.py3000100% 
   cross_validation_report.py121228398%224, 264
   estimator_report.py10000100% 
   report.py60060100% 
skore/src/skore/_plugins/local
   __init__.py2000100% 
   metadata.py8138196%29, 141–142
   project.py93130198%238
   storage.py4226195%45, 189
skore/src/skore/_plugins/mlflow
   __init__.py5000100% 
   project.py2091554592%202, 233–234, 380, 382, 398, 400–405, 407–409
   reports.py155634496%129, 170, 207–208, 270, 283
skore/src/skore/_project
   __init__.py0000100% 
   _summary.py80138398%121
   _widget.py1910442100% 
   dependencies.py19060100% 
   git.py25040100% 
   login.py1736282%62, 71–72
   plugin.py12020100% 
   project.py56216396%132, 141
   types.py3000100% 
skore/src/skore/_sklearn
   __init__.py8000100% 
   _base.py54110098%44
   compare.py5000100% 
   evaluate.py430240100% 
   feature_names.py260120100% 
   find_ml_task.py610462100% 
   metrics.py3160761100% 
   types.py1910094%31
skore/src/skore/_sklearn/_checks
   __init__.py3000100% 
   _utils.py47320393%47, 147, 155
   accessor.py33114096%17
   base.py76524393%128–129, 169, 257–258
   model_checks.py163440497%320, 328, 364, 368
skore/src/skore/_sklearn/_comparison
   __init__.py9000100% 
   inspection_accessor.py2712096%347
   metrics_accessor.py122418496%259–260, 329, 1115
   report.py160568096%577, 583, 641–643
skore/src/skore/_sklearn/_cross_validation
   __init__.py11000100% 
   data_accessor.py36212294%48, 74
   inspection_accessor.py2712096%319
   metrics_accessor.py120318397%214–215, 1077
   report.py2021048695%73, 78, 83, 324, 598, 642, 648, 734–736
skore/src/skore/_sklearn/_estimator
   __init__.py11000100% 
   data_accessor.py48220195%61, 178
   inspection_accessor.py3718297%278
   metrics_accessor.py1250220100% 
   report.py32914921095%60, 74, 295, 368, 453, 710, 799, 818, 820, 826–827, 914–916
skore/src/skore/_sklearn/_plot
   __init__.py3000100% 
   base.py61214196%61–62
   utils.py145366397%254–255, 428
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.py1980662100% 
   metrics_summary_display.py152174299%290
   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.py33210393%46, 49
   _fixes.py8020100% 
   _index.py5020100% 
   _jupyter.py820075%13–14
   _measure_time.py10000100% 
   _parallel.py17000100% 
   _patch.py21128842%30, 35–39, 42–43, 46–47, 58, 60
   _progress_bar.py4244090%53–54, 64–65
   _show_versions.py380120100% 
   _skrub.py37040100% 
   _testing.py1281412289%24, 33, 71–72, 94, 193, 202, 213–218, 220
skore/src/skore/_utils/repr
   __init__.py2000100% 
   base.py54040100% 
   data.py1280301100% 
   html_repr.py40000100% 
   rich_repr.py800223100% 
   utils.py11020100% 
TOTAL7302228183815096% 

Tests Skipped Failures Errors Time
2564 6 💤 0 ❌ 0 🔥 8m 50s ⏱️

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Documentation preview @ 12a7bef

@auguste-probabl

This comment was marked as outdated.

jeromedockes
jeromedockes previously approved these changes May 18, 2026
Copy link
Copy Markdown
Collaborator

@jeromedockes jeromedockes left a comment

Choose a reason for hiding this comment

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

thanks @auguste-probabl ! I think your proposed organization is good:

  • original_estimator is whatever the user gave, without transformations
  • learner_ is the fitted object, with a skrublearner interface (predict({...}) ). if original_estimator had the scikit-learn interface (predict(X, y)) it is wrapped in an adapter. learner_ is what is used almost everywhere internally
  • estimator_ is the fitted object without wrapping, ie with the same interface as original_estimator -- the interface expected by the user

@glemaitre WDYT

Comment thread skore/src/skore/_sklearn/_estimator/report.py Outdated
Comment thread skore/src/skore/_sklearn/_estimator/report.py Outdated
Comment thread skore/src/skore/_sklearn/_estimator/report.py Outdated
Previously we had `estimator`, `estimator_` and `_estimator`.
Copy link
Copy Markdown
Collaborator

@jeromedockes jeromedockes left a comment

Choose a reason for hiding this comment

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

thank you @auguste-probabl , LGTM!

@auguste-probabl auguste-probabl enabled auto-merge May 20, 2026 09:20
@auguste-probabl auguste-probabl added this pull request to the merge queue May 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 20, 2026
@auguste-probabl auguste-probabl added this pull request to the merge queue May 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 20, 2026
@auguste-probabl auguste-probabl added this pull request to the merge queue May 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 20, 2026
@auguste-probabl auguste-probabl added this pull request to the merge queue May 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 20, 2026
@auguste-probabl auguste-probabl added this pull request to the merge queue May 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 20, 2026
Copy link
Copy Markdown
Member

@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM

@glemaitre glemaitre added this pull request to the merge queue May 20, 2026
@glemaitre
Copy link
Copy Markdown
Member

Thanks @auguste-probabl

@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 20, 2026
@auguste-probabl auguste-probabl added this pull request to the merge queue May 21, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 21, 2026
@glemaitre glemaitre added this pull request to the merge queue May 21, 2026
Merged via the queue into probabl-ai:main with commit e905654 May 21, 2026
38 checks passed
@glemaitre glemaitre deleted the rename-_estimator branch May 21, 2026 10:56
@jeromedockes
Copy link
Copy Markdown
Collaborator

great! 🎉

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.

3 participants