.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/technical_details/plot_skore_local_project.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_technical_details_plot_skore_local_project.py: .. _example_skore_local_project: =================== Local skore Project =================== This example shows how to use :class:`~skore.Project` in **local** mode: store reports on your machine and inspect them. A key point is that :meth:`~skore.Project.summarize` returns a :class:`~skore.project._summary.Summary`, which is a :class:`pandas.DataFrame`. In Jupyter you get an interactive widget, but you can always inspect and filter the summary as a DataFrame if you prefer. .. GENERATED FROM PYTHON SOURCE LINES 16-22 Create a local project and store reports ========================================= We use a temporary directory as the workspace so the example is self-contained. In practice you can omit ``workspace`` to use the default (e.g. a ``skore/`` directory in your user cache). .. GENERATED FROM PYTHON SOURCE LINES 22-31 .. code-block:: Python from pathlib import Path from tempfile import TemporaryDirectory from skore import Project tmp_dir = TemporaryDirectory() tmp_path = Path(tmp_dir.name) project = Project("example-project", workspace=tmp_path) .. GENERATED FROM PYTHON SOURCE LINES 32-41 .. code-block:: Python from sklearn.datasets import load_breast_cancer from sklearn.linear_model import LogisticRegression from skore import train_test_split from skrub import tabular_pipeline X, y = load_breast_cancer(return_X_y=True, as_frame=True) split_data = train_test_split(X=X, y=y, random_state=42, as_dict=True) estimator = tabular_pipeline(LogisticRegression(max_iter=1_000)) .. rst-class:: sphx-glr-script-out .. code-block:: none ╭────────────────────── HighClassImbalanceTooFewExamplesWarning ───────────────────────╮ │ It seems that you have a classification problem with at least one class with fewer │ │ than 100 examples in the test set. In this case, using train_test_split may not be a │ │ good idea because of high variability in the scores obtained on the test set. We │ │ suggest three options to tackle this challenge: you can increase test_size, collect │ │ more data, or use skore's CrossValidationReport with the `splitter` parameter of │ │ your choice. │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────── ShuffleTrueWarning ─────────────────────────────────╮ │ We detected that the `shuffle` parameter is set to `True` either explicitly or from │ │ its default value. In case of time-ordered events (even if they are independent), │ │ this will result in inflated model performance evaluation because natural drift will │ │ not be taken into account. We recommend setting the shuffle parameter to `False` in │ │ order to ensure the evaluation process is really representative of your production │ │ release process. │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ .. GENERATED FROM PYTHON SOURCE LINES 42-54 .. code-block:: Python import numpy as np from sklearn.base import clone from skore import EstimatorReport for regularization in np.logspace(-7, 7, 31): report = EstimatorReport( clone(estimator).set_params(logisticregression__C=regularization), **split_data, pos_label=1, ) project.put(f"lr-regularization-{regularization:.1e}", report) .. GENERATED FROM PYTHON SOURCE LINES 55-61 Summarize: you get a DataFrame ============================== :meth:`~skore.Project.summarize` returns a :class:`~skore.project._summary.Summary`, which subclasses :class:`pandas.DataFrame`. In a Jupyter environment it renders an interactive parallel-coordinates widget by default. .. GENERATED FROM PYTHON SOURCE LINES 61-63 .. code-block:: Python summary = project.summarize() .. GENERATED FROM PYTHON SOURCE LINES 64-66 To see the normal DataFrame table instead of the widget (e.g. in scripts or when you prefer the table), wrap the summary in :class:`pandas.DataFrame`: .. GENERATED FROM PYTHON SOURCE LINES 66-71 .. code-block:: Python import pandas as pd pandas_summary = pd.DataFrame(summary) pandas_summary .. raw:: html
key date learner ml_task report_type dataset rmse log_loss roc_auc fit_time predict_time rmse_mean log_loss_mean roc_auc_mean fit_time_mean predict_time_mean
id
0 18e3dfcadc5c0a99fedfc61986092a42 lr-regularization-1.0e-07 2026-03-12T17:28:23.220909+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.662918 0.992509 0.125920 0.086460 None None None None None
1 f8dffb4cc20762c6b063c858b3940ffa lr-regularization-2.9e-07 2026-03-12T17:28:23.475862+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.662790 0.992509 0.125120 0.060921 None None None None None
2 9447faa79f0ed2c2d65c4418faabde63 lr-regularization-8.6e-07 2026-03-12T17:28:23.641549+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.662415 0.992509 0.067257 0.043938 None None None None None
3 49524384beecbdf0190c4fc4660d99ce lr-regularization-2.5e-06 2026-03-12T17:28:23.788142+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.661320 0.992509 0.067750 0.041599 None None None None None
4 c71541a317f00354d737f646625896fd lr-regularization-7.4e-06 2026-03-12T17:28:23.933658+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.658141 0.992509 0.067927 0.040740 None None None None None
5 692b35dc3a11badd760518a230bbdfec lr-regularization-2.2e-05 2026-03-12T17:28:24.075495+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.649068 0.992509 0.065648 0.040318 None None None None None
6 a844b7fcb912461a685c79b683cb5356 lr-regularization-6.3e-05 2026-03-12T17:28:24.258383+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.624398 0.992926 0.103330 0.041839 None None None None None
7 904c97378911ba3be3e87271cae2eefb lr-regularization-1.8e-04 2026-03-12T17:28:24.404774+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.565558 0.993550 0.069180 0.041749 None None None None None
8 88d9227af3b614c07e31e8d8e3c31ffb lr-regularization-5.4e-04 2026-03-12T17:28:24.547158+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.460542 0.994382 0.066927 0.040088 None None None None None
9 fee238d37e63dbaea525b21f0cd109cd lr-regularization-1.6e-03 2026-03-12T17:28:24.691468+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.336408 0.996047 0.067169 0.042055 None None None None None
10 39fad5a3391cdd3acdb7219209f4568c lr-regularization-4.6e-03 2026-03-12T17:28:24.908480+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.231201 0.997087 0.124476 0.080992 None None None None None
11 40d6cdbaa1ce2ef259a9c120df95c253 lr-regularization-1.4e-02 2026-03-12T17:28:25.167718+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.155570 0.998335 0.128861 0.042165 None None None None None
12 168b9fe125b66b88241d21cfdf5d15ee lr-regularization-4.0e-02 2026-03-12T17:28:25.324808+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.105629 0.998752 0.068314 0.070766 None None None None None
13 372afbb5a10b31cb69ae207d372b548d lr-regularization-1.2e-01 2026-03-12T17:28:25.559058+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.075737 0.998752 0.111055 0.063262 None None None None None
14 8bd7c94e22145b7ad9643a50bc60c6fc lr-regularization-3.4e-01 2026-03-12T17:28:25.796332+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.060118 0.997919 0.113372 0.071172 None None None None None
15 d73ee33904a2a0406553af8590d1687f lr-regularization-1.0e+00 2026-03-12T17:28:26.031623+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.054072 0.997919 0.110689 0.079620 None None None None None
16 99bea2ac085df1eeea8077a2fcb06372 lr-regularization-2.9e+00 2026-03-12T17:28:26.287721+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.055710 0.997711 0.120812 0.069248 None None None None None
17 a72cbff09a57687f236e06f449bee5e1 lr-regularization-8.6e+00 2026-03-12T17:28:26.531563+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.062826 0.997503 0.117301 0.089758 None None None None None
18 0f805a3ae7d1383f3cb398ec11a139a4 lr-regularization-2.5e+01 2026-03-12T17:28:26.824725+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.080149 0.996463 0.141615 0.084829 None None None None None
19 03fc01d6426a066cb805675a2d4e58d3 lr-regularization-7.4e+01 2026-03-12T17:28:27.102948+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.129595 0.993550 0.142571 0.082397 None None None None None
20 cb99ab05650479079ac7d7aa84da5df9 lr-regularization-2.2e+02 2026-03-12T17:28:27.386623+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.245793 0.990845 0.147477 0.089486 None None None None None
21 b10e7da7a5f971c7e3054a40ac66cc42 lr-regularization-6.3e+02 2026-03-12T17:28:27.676108+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.456457 0.989180 0.138388 0.085190 None None None None None
22 ccd993f2a57af04110d6bb1279f41934 lr-regularization-1.8e+03 2026-03-12T17:28:27.962387+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 0.755451 0.987516 0.144608 0.081557 None None None None None
23 5fd9ff8a4c6b8eacd5dbe354acb94fe8 lr-regularization-5.4e+03 2026-03-12T17:28:28.259570+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 1.135445 0.987308 0.146437 0.083388 None None None None None
24 f9bdf75e1c2e7ec57a9e8dcf7f1a3ac4 lr-regularization-1.6e+04 2026-03-12T17:28:28.534327+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 1.566408 0.982834 0.140542 0.053958 None None None None None
25 128be0b1e26f58dce3a11e7737c54846 lr-regularization-4.6e+04 2026-03-12T17:28:28.695717+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 1.921192 0.982418 0.070464 0.066177 None None None None None
26 5b7c13c577a928cb0b9ddff0ea717e3c lr-regularization-1.4e+05 2026-03-12T17:28:28.943643+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 2.001411 0.982626 0.118828 0.067372 None None None None None
27 4192f1f27d23fb52abd635108d3d25d3 lr-regularization-4.0e+05 2026-03-12T17:28:29.182902+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 2.192980 0.981898 0.118680 0.067617 None None None None None
28 29e8b1c92f5a7f91be7c245adc882a0d lr-regularization-1.2e+06 2026-03-12T17:28:29.417020+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 2.268483 0.973159 0.118297 0.068874 None None None None None
29 8f47b9fd7916e679d3757d343c5ed4e4 lr-regularization-3.4e+06 2026-03-12T17:28:29.650040+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 2.268482 0.973367 0.115793 0.068494 None None None None None
30 f230ad3b84b922747618f3d2facd5c35 lr-regularization-1.0e+07 2026-03-12T17:28:29.882330+00:00 LogisticRegression binary-classification estimator 0966e6e4b6a8c8bd5b0e6bd95f36939d None 2.268482 0.973159 0.116085 0.067875 None None None None None


.. GENERATED FROM PYTHON SOURCE LINES 72-74 Basically, our summary contains metadata related to various information that we need to quickly help filtering the reports. .. GENERATED FROM PYTHON SOURCE LINES 74-76 .. code-block:: Python summary.info() .. rst-class:: sphx-glr-script-out .. code-block:: none MultiIndex: 31 entries, (0, '18e3dfcadc5c0a99fedfc61986092a42') to (30, 'f230ad3b84b922747618f3d2facd5c35') Data columns (total 16 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 key 31 non-null object 1 date 31 non-null object 2 learner 31 non-null category 3 ml_task 31 non-null object 4 report_type 31 non-null object 5 dataset 31 non-null object 6 rmse 0 non-null object 7 log_loss 31 non-null float64 8 roc_auc 31 non-null float64 9 fit_time 31 non-null float64 10 predict_time 31 non-null float64 11 rmse_mean 0 non-null object 12 log_loss_mean 0 non-null object 13 roc_auc_mean 0 non-null object 14 fit_time_mean 0 non-null object 15 predict_time_mean 0 non-null object dtypes: category(1), float64(4), object(11) memory usage: 5.3+ KB .. GENERATED FROM PYTHON SOURCE LINES 77-79 Filter reports by metric (e.g. keep only those above a given accuracy) and work with the result as a table. .. GENERATED FROM PYTHON SOURCE LINES 79-81 .. code-block:: Python summary.query("log_loss < 0.1")["key"].tolist() .. rst-class:: sphx-glr-script-out .. code-block:: none ['lr-regularization-1.2e-01', 'lr-regularization-3.4e-01', 'lr-regularization-1.0e+00', 'lr-regularization-2.9e+00', 'lr-regularization-8.6e+00', 'lr-regularization-2.5e+01'] .. GENERATED FROM PYTHON SOURCE LINES 82-84 Use :meth:`~skore.project._summary.Summary.reports` to load the corresponding reports from the project (optionally after filtering the summary). .. GENERATED FROM PYTHON SOURCE LINES 84-87 .. code-block:: Python reports = summary.query("log_loss < 0.1").reports(return_as="comparison") len(reports.reports_) .. rst-class:: sphx-glr-script-out .. code-block:: none 6 .. GENERATED FROM PYTHON SOURCE LINES 88-90 Since we got a :class:`~skore.ComparisonReport`, we can use the metrics accessor to summarize the metrics across the reports. .. GENERATED FROM PYTHON SOURCE LINES 90-92 .. code-block:: Python reports.metrics.summarize().frame() .. raw:: html
Estimator LogisticRegression_1 LogisticRegression_2 LogisticRegression_3 LogisticRegression_4 LogisticRegression_5 LogisticRegression_6
Metric
Accuracy 0.993007 0.993007 0.993007 0.979021 0.972028 0.979021
Precision 0.988889 0.988889 0.988889 0.988636 0.988506 0.988636
Recall 1.000000 1.000000 1.000000 0.977528 0.966292 0.977528
ROC AUC 0.998752 0.997919 0.997919 0.997711 0.997503 0.996463
Brier score 0.016769 0.014335 0.013810 0.015269 0.017996 0.022781
Fit time (s) 0.111055 0.113372 0.110689 0.120812 0.117301 0.141615
Predict time (s) 0.066876 0.066389 0.066894 0.040264 0.040260 0.041271


.. GENERATED FROM PYTHON SOURCE LINES 93-95 .. code-block:: Python reports.metrics.roc().plot(subplot_by=None) .. image-sg:: /auto_examples/technical_details/images/sphx_glr_plot_skore_local_project_001.png :alt: ROC Curve Positive label: 1 Data source: Test set :srcset: /auto_examples/technical_details/images/sphx_glr_plot_skore_local_project_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 96-98 .. code-block:: Python project.delete("example-project", workspace=tmp_path) tmp_dir.cleanup() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 8.741 seconds) .. _sphx_glr_download_auto_examples_technical_details_plot_skore_local_project.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_skore_local_project.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_skore_local_project.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_skore_local_project.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_