Skip to content

Conversation

@FrancoisPgm
Copy link
Contributor

Fixes #2039

The colab button to convert a dataframe into an interactive table appears to call the dataframe's _repr_html_, so when it is used on a summary (which inherits from the dataframe class), the widget would be displayed a second time as _repr_html_ is called again.

The proposed solution is to display the widget in _repr_mimebundle_ and override _repr_html_ to return an empty string.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Caution

Some commits in the pull request are not signed, or GitHub is not able to verify the signature.
Please sign all your commits; you can find more information here.
Please note that when you activate commit signing, you'll need to retroactively sign your previous commits.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Documentation preview @ 9427af5

@github-actions
Copy link
Contributor

github-actions bot commented Oct 6, 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% 
   types.py27196%28
skore/src/skore/_sklearn/_comparison
   __init__.py70100% 
   feature_importance_accessor.py39294%90, 109
   metrics_accessor.py178398%173, 253, 1215
   report.py1070100% 
   utils.py540100% 
skore/src/skore/_sklearn/_cross_validation
   __init__.py90100% 
   data_accessor.py45393%128, 131, 134
   feature_importance_accessor.py240100% 
   metrics_accessor.py182199%244
   report.py135199%487
skore/src/skore/_sklearn/_estimator
   __init__.py90100% 
   data_accessor.py580100% 
   feature_importance_accessor.py144298%223–224
   metrics_accessor.py356897%200, 202, 209, 300, 369, 373, 388, 423
   report.py167298%448–449
skore/src/skore/_sklearn/_plot
   __init__.py30100% 
   base.py102793%61–62, 200, 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.py280598%455, 555, 559, 619, 751
   prediction_error.py227597%179, 186, 422, 505, 705
   roc_curve.py292897%385, 508, 513, 614, 619, 623, 692, 832
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.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% 
   _repr_html.py80100% 
   _show_versions.py380100% 
   _testing.py550100% 
skore/src/skore/project
   __init__.py20100% 
   project.py480100% 
   summary.py75198%120
   widget.py165696%436, 439–441, 525–526
TOTAL399711797% 

Tests Skipped Failures Errors Time
1062 5 💤 0 ❌ 0 🔥 4m 19s ⏱️

Copy link
Contributor

@auguste-probabl auguste-probabl left a comment

Choose a reason for hiding this comment

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

Nice work!

@auguste-probabl
Copy link
Contributor

I see that your commits are not signed btw

@auguste-probabl auguste-probabl added this pull request to the merge queue Oct 6, 2025
@FrancoisPgm
Copy link
Contributor Author

The two first ones are not but the third one should be, I created a GPG key after seeing the gh action warning.

Merged via the queue into probabl-ai:main with commit 35bc09e Oct 6, 2025
32 checks passed
@auguste-probabl
Copy link
Contributor

You can sign commits after making them, if you can force-push.
Once the commits are signed (you can use an SSH key to sign, not only GPG), you need to give GitHub your public key for it to verify the signature; that's why your 3rd commit is marked "Unverified".
More info here: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

@FrancoisPgm FrancoisPgm deleted the bug_summary_colab branch October 6, 2025 09:28
@thomass-dev
Copy link
Collaborator

This PR changes the representation of the Summary object in IPython:

In [3]: project.summarize()
Out[3]: <IPython.core.display.HTML object>
VBox(children=(VBox(children=(HBox(children=(Dropdown(description='Report Type:', layout=Layout(flex='1'), opt…
FigureWidget({
    'data': [{'dimensions': [{'label': 'Learner',
                              'ticktext': array(['LinearRegression'], dtype=object),
                              'tickvals': array([0]),
                              'values': array([0, 0], dtype=int8)},
                             {'label': 'RMSE', 'values': array([66.40851226, 66.40851226])}],
              'labelangle': -30,
              'line': {'color': array([66.40851226, 66.40851226]),
                       'colorbar': {'title': {'text': 'RMSE'}},
                       'colorscale': [[0.0, '#fde725'], [0.1111111111111111,
                                      '#b5de2b'], [0.2222222222222222, '#6ece58'],
                                      [0.3333333333333333, '#35b779'],
                                      [0.4444444444444444, '#1f9e89'],
                                      [0.5555555555555556, '#26828e'],
                                      [0.6666666666666666, '#31688e'],
                                      [0.7777777777777778, '#3e4989'],
                                      [0.8888888888888888, '#482878'], [1.0,
                                      '#440154']],
                       'showscale': True},
              'type': 'parcoords',
              'uid': '7a1497a3-1a3d-4fd0-b3fb-ab09b9fefaba'}],
    'layout': {'font': {'size': 18}, 'height': 500, 'margin': {'b': 30, 'l': 250, 'r': 0, 't': 120}, 'template': '...'}
})

                                                                          key                              date           learner     ml_task       report_type  ...   rmse_mean  log_loss_mean roc_auc_mean fit_time_mean  predict_time_mean
  id                                                                                                                                                             ...                                                                         
0 skore:report:estimator:1                 estimator-report: LinearRegression  2025-10-14T10:23:53.132733+00:00  LinearRegression  regression         estimator  ...         NaN           None         None           NaN                NaN
1 skore:report:cross-validation:2   cross-validation-report: LinearRegression  2025-10-14T10:24:57.862750+00:00  LinearRegression  regression  cross-validation  ...  108.639532           None         None      0.003301           0.000277
2 skore:report:estimator:28                estimator-report: LinearRegression  2025-10-17T08:41:33.197927+00:00  LinearRegression  regression         estimator  ...         NaN           None         None           NaN                NaN
3 skore:report:cross-validation:29  cross-validation-report: LinearRegression  2025-10-17T08:42:19.266918+00:00  LinearRegression  regression  cross-validation  ...  108.639532           None         None      0.000754           0.000282

[4 rows x 16 columns]

Could you find a way to disable the representation of the widget in IPython and let Pandas make its representation?

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.

bug(skore): Project summary's parallel coordinates plot is shown a 2nd time

3 participants