.. 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-39 .. code-block:: Python from sklearn.datasets import load_breast_cancer from sklearn.linear_model import LogisticRegression from skrub import tabular_pipeline X, y = load_breast_cancer(return_X_y=True, as_frame=True) estimator = tabular_pipeline(LogisticRegression(max_iter=1_000)) .. GENERATED FROM PYTHON SOURCE LINES 40-54 .. code-block:: Python import numpy as np from sklearn.base import clone from skore import evaluate for regularization in np.logspace(-7, 7, 31): report = evaluate( clone(estimator).set_params(logisticregression__C=regularization), X, y, splitter=0.2, 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 3fbdfcd9f9538d4bb88ed5c07100a044 lr-regularization-1.0e-07 2026-03-27T09:49:09.021060+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.682846 0.984122 0.135014 0.082807 None None None None None
1 5f50a33d13033842db40da06e6c68caa lr-regularization-2.9e-07 2026-03-27T09:49:09.298343+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.682710 0.984122 0.132288 0.081778 None None None None None
2 dace7f5ce17445bd1ab21b4da3bc9aa1 lr-regularization-8.6e-07 2026-03-27T09:49:09.576888+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.682313 0.984122 0.134454 0.082845 None None None None None
3 5656ab4516bc25a1bd49ed5efc1136ad lr-regularization-2.5e-06 2026-03-27T09:49:09.862049+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.681153 0.984122 0.138487 0.080196 None None None None None
4 79269af5f739d8fa53e62d7962c25008 lr-regularization-7.4e-06 2026-03-27T09:49:10.139300+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.677790 0.984122 0.135002 0.082924 None None None None None
5 ef3a85c4ef488c7ee2f107f81e7a4328 lr-regularization-2.2e-05 2026-03-27T09:49:10.425333+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.668210 0.984122 0.140624 0.085842 None None None None None
6 cde24895e25f1d44b4cf60f2da856d7b lr-regularization-6.3e-05 2026-03-27T09:49:10.707597+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.642328 0.985075 0.133330 0.082226 None None None None None
7 54b29f2eafdf10bbc63d2abd579c2a30 lr-regularization-1.8e-04 2026-03-27T09:49:10.990801+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.581579 0.985392 0.137051 0.082348 None None None None None
8 4ceec62004ce56b435732d783e16059e lr-regularization-5.4e-04 2026-03-27T09:49:11.271129+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.476411 0.985710 0.131880 0.083591 None None None None None
9 97fbb19c6cd5f300c91b31a6020a305c lr-regularization-1.6e-03 2026-03-27T09:49:11.564211+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.355309 0.987615 0.141054 0.077352 None None None None None
10 9a5ea73dffeae831d00a8064a6a67d6f lr-regularization-4.6e-03 2026-03-27T09:49:11.847426+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.252513 0.990156 0.147057 0.073233 None None None None None
11 664e51ca2e36e4e7c6c968ee8317692f lr-regularization-1.4e-02 2026-03-27T09:49:12.097267+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.178052 0.992379 0.116773 0.071193 None None None None None
12 40d04ec455d115bd827b1fab05486636 lr-regularization-4.0e-02 2026-03-27T09:49:12.339757+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.128754 0.995872 0.115002 0.071011 None None None None None
13 8ae57831ff52218291f55e19039807f0 lr-regularization-1.2e-01 2026-03-27T09:49:12.609943+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.098897 0.996189 0.134009 0.082191 None None None None None
14 66a5d324568959c016522c1cb9503ae4 lr-regularization-3.4e-01 2026-03-27T09:49:12.879669+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.083941 0.995872 0.126387 0.079756 None None None None None
15 7f00d879403de0d0257cc6c5ca6018c1 lr-regularization-1.0e+00 2026-03-27T09:49:13.154599+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.080457 0.995554 0.131740 0.088751 None None None None None
16 c2e1d6c8d59bc522c43a7b42635f4f17 lr-regularization-2.9e+00 2026-03-27T09:49:13.477457+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.089466 0.994601 0.146826 0.079874 None None None None None
17 eb5e3d34d97dcc6c048827d51d1911e5 lr-regularization-8.6e+00 2026-03-27T09:49:13.753331+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.104241 0.993649 0.135233 0.083316 None None None None None
18 3e1272453f1d071b47035089dc319387 lr-regularization-2.5e+01 2026-03-27T09:49:14.049750+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.121671 0.992379 0.147465 0.079415 None None None None None
19 e57eee93441eca46f8efc89b26f1e8dc lr-regularization-7.4e+01 2026-03-27T09:49:14.313850+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.142282 0.991426 0.122257 0.073116 None None None None None
20 8eecb973160a3b3a28ca71e861587778 lr-regularization-2.2e+02 2026-03-27T09:49:14.576177+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.162450 0.991426 0.130317 0.062411 None None None None None
21 1918b66b7232ea0c56f49208b68afc7f lr-regularization-6.3e+02 2026-03-27T09:49:14.844726+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.204586 0.991108 0.141823 0.070447 None None None None None
22 ae3feedb9b9321ffd43a3dd16dbed9bd lr-regularization-1.8e+03 2026-03-27T09:49:15.093771+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.291953 0.990473 0.122912 0.067768 None None None None None
23 30729159207c19a074fa8795439804e0 lr-regularization-5.4e+03 2026-03-27T09:49:15.342285+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.471382 0.989838 0.126374 0.067559 None None None None None
24 abb36409badd4dfa3b127d5cef575c64 lr-regularization-1.6e+04 2026-03-27T09:49:15.608910+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 0.796526 0.983169 0.142335 0.068014 None None None None None
25 5cc92a879c16ea93abe2e42a592faee2 lr-regularization-4.6e+04 2026-03-27T09:49:15.882208+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 1.133167 0.984757 0.149053 0.068060 None None None None None
26 caac74020a0bff2c67d93d38393d72da lr-regularization-1.4e+05 2026-03-27T09:49:16.152280+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 1.229179 0.985551 0.147479 0.068330 None None None None None
27 1cf8310fce623afd00ea5d81e4c6a55b lr-regularization-4.0e+05 2026-03-27T09:49:16.423623+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 1.276041 0.985869 0.147682 0.067844 None None None None None
28 8f5277671db50fe2aaf83874fd52f95c lr-regularization-1.2e+06 2026-03-27T09:49:16.696645+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 1.447319 0.975865 0.146442 0.067662 None None None None None
29 bfcdb9e4eb303bd4c9ef67155c6b7e84 lr-regularization-3.4e+06 2026-03-27T09:49:16.961184+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 1.448698 0.976500 0.140477 0.067735 None None None None None
30 b55da601301c6d54515d3fdf611be38b lr-regularization-1.0e+07 2026-03-27T09:49:17.222794+00:00 LogisticRegression binary-classification estimator a36fcd73fd752ec31662e617f0f6e127 None 1.897034 0.976183 0.139384 0.067348 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, '3fbdfcd9f9538d4bb88ed5c07100a044') to (30, 'b55da601301c6d54515d3fdf611be38b') 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'] .. 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 4 .. 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
Metric
Accuracy 0.947368 0.964912 0.964912 0.964912
Precision 0.942029 0.970149 0.970149 0.970149
Recall 0.970149 0.970149 0.970149 0.970149
ROC AUC 0.996189 0.995872 0.995554 0.994601
Brier score 0.027157 0.024990 0.025149 0.026218
Fit time (s) 0.134009 0.126387 0.131740 0.146826
Predict time (s) 0.067182 0.066196 0.056570 0.057216


.. 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 .. rst-class:: sphx-glr-script-out .. code-block:: none
.. 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 9.928 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 `_