From 462c041c197d3c77622387b94eb0b08b935a6669 Mon Sep 17 00:00:00 2001 From: Thomas S Date: Mon, 2 Dec 2024 09:42:41 +0100 Subject: [PATCH] docs: Deploy documentation artifacts to S3 (#745) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace the use of `gh-pages` by S3 bucket: the commits history remains light and clean, - Create a new version of the documentation after each release of `skore`, - Add a drop-down list allowing user to select the last 10 versions (+ `dev`) of the documentation of `skore`, - Running locally `make html` build documentation with a `dev` tag. --- After each __commit__ on the `main` branch, the documentation is build and deployed on the `S3:dev/` directory. After each __release__, the documentation is build and deployed to the `S3:version/` directory, the version being a subpart of the tag `MAJOR.MINOR.BUGFIX`: `MAJOR.MINOR`. For instance, with the following timeline: ``` dev/ dev/ dev/ dev/ dev/ 0.1/ 0.2/ main -- x -- x -- x -- x -- x -- > | | tag 0.1 0.2 ``` The S3 bucket looks like: ``` . ├── 0.1/ ├── 0.2/ ├── dev/ ├── index.html └── versions.json ``` --- .github/actions/sphinx/build/action.yml | 12 +- .github/actions/sphinx/deploy/action.yml | 41 +- .github/workflows/sphinx.yml | 165 ++++- .../plot_02_train_test_split.py} | 0 .../auto_examples_python.zip | Bin 34099 -> 34221 bytes .../plot_01_cross_validate.ipynb} | 0 .../plot_01_cross_validate.py} | 0 .../plot_01_getting_started.ipynb | 0 .../plot_02_tracking_items.py} | 0 .../plot_01_cross_validate.zip} | Bin 15411 -> 15411 bytes .../auto_examples_jupyter.zip | Bin 60646 -> 60768 bytes .../plot_02_train_test_split.ipynb} | 0 .../plot_01_getting_started.py | 0 .../plot_01_overview_skore_project.zip} | Bin 24268 -> 24268 bytes .../plot_02_train_test_split.zip} | Bin 20051 -> 20051 bytes .../plot_02_tracking_items.zip} | Bin 15741 -> 15741 bytes .../plot_02_tracking_items.ipynb} | 0 .../plot_01_overview_skore_project.py} | 0 .../plot_01_overview_skore_project.ipynb} | 0 .../plot_01_getting_started.zip | Bin 19340 -> 19340 bytes ...sphx_glr_plot_01_cross_validate_thumb.png} | Bin .../sphx_glr_plot_01_getting_started_001.png | Bin 50342 -> 50342 bytes ...lr_plot_01_overview_skore_project_001.png} | Bin 70499 -> 70499 bytes ..._plot_01_overview_skore_project_thumb.png} | Bin ...sphx_glr_plot_02_tracking_items_thumb.png} | Bin ...hx_glr_plot_02_train_test_split_thumb.png} | Bin .../00_getting_started/index.rst.txt | 47 ++ .../plot_01_getting_started.rst.txt | 22 +- .../auto_examples/01_track/index.rst.txt | 64 ++ .../plot_01_overview_skore_project.rst.txt} | 92 +-- .../plot_02_tracking_items.rst.txt} | 48 +- .../auto_examples/02_diagnose/index.rst.txt | 65 ++ .../plot_01_cross_validate.rst.txt} | 24 +- .../plot_02_train_test_split.rst.txt} | 22 +- .../_sources/auto_examples/index.rst.txt | 105 +++- docs/latest/api.html | 4 +- .../00_getting_started/index.html | 580 +++++++++++++++++ .../plot_01_getting_started.html | 192 +++--- docs/latest/auto_examples/01_track/index.html | 582 +++++++++++++++++ .../plot_01_overview_skore_project.html} | 284 +++++---- .../plot_02_tracking_items.html} | 204 +++--- .../auto_examples/02_diagnose/index.html | 583 ++++++++++++++++++ .../plot_01_cross_validate.html} | 190 +++--- .../plot_02_train_test_split.html} | 190 +++--- docs/latest/auto_examples/index.html | 75 ++- .../generated/skore.cross_validate.html | 4 +- .../generated/skore.train_test_split.html | 2 +- docs/latest/getting_started.html | 2 +- docs/latest/index.html | 2 +- docs/latest/install.html | 2 +- docs/latest/objects.inv | Bin 1151 -> 1268 bytes docs/latest/searchindex.js | 2 +- sphinx/Makefile | 11 +- sphinx/conf.py | 30 +- 54 files changed, 2965 insertions(+), 681 deletions(-) rename docs/latest/_downloads/{14e353ee268e214967a45032a868744b/plot_05_train_test_split.py => 024736589b9c3fa37859d9272c9a8cdb/plot_02_train_test_split.py} (100%) rename docs/latest/_downloads/{9825adffd8a0e006b517b57261e52107/plot_03_cross_validate.ipynb => 09272384888d8342b36e27849f5a423b/plot_01_cross_validate.ipynb} (100%) rename docs/latest/_downloads/{b53d88bff5e11c5ed50d2a0f66cc5fb1/plot_03_cross_validate.py => 4959241c3e7438e965030c696b8fe135/plot_01_cross_validate.py} (100%) rename docs/latest/_downloads/{e97c5b0c37bdd66afd2a201f006613dd => 4b40eda73b3a29a34f59bbd8834fb5d8}/plot_01_getting_started.ipynb (100%) rename docs/latest/_downloads/{ce85e1a88bd0b4fce657c932abde8d0d/plot_04_tracking_items.py => 64023e9042dd6e8c819e3672ab30e7b3/plot_02_tracking_items.py} (100%) rename docs/latest/_downloads/{dafe7022153ade7f6466ced5b7bc6a6d/plot_03_cross_validate.zip => 66d65b1172294c11e4127bb963835935/plot_01_cross_validate.zip} (98%) rename docs/latest/_downloads/{4b860fd94d1a8cca99a690486b997717/plot_05_train_test_split.ipynb => 71bbf371dfb7015d24d94c208c08288b/plot_02_train_test_split.ipynb} (100%) rename docs/latest/_downloads/{3feb988b860c59c9cee8450bd29651e5 => 892f5cbeed7112a7009bfb2f5f6870e0}/plot_01_getting_started.py (100%) rename docs/latest/_downloads/{26cde164bdb63562f0a03fb130aaa53a/plot_02_overview_skore_project.zip => 9730fbfa0227d4cbaee43dd3146ea016/plot_01_overview_skore_project.zip} (98%) rename docs/latest/_downloads/{cdd7bc0df44925960cbfd8a4588515de/plot_05_train_test_split.zip => 9ecad9d310c18cfcb34e6f41dc43832c/plot_02_train_test_split.zip} (98%) rename docs/latest/_downloads/{b10f2525b5ecaf48aa269d4d66baefe0/plot_04_tracking_items.zip => a3a1956f20f72c86db7fe85f16458c1e/plot_02_tracking_items.zip} (98%) rename docs/latest/_downloads/{9b9c37c8a93d46bbd84e5f80dd1da442/plot_04_tracking_items.ipynb => a64f279aa9bc0515948c84c4a66b9486/plot_02_tracking_items.ipynb} (100%) rename docs/latest/_downloads/{c9799dfd1f6d1cf8a38654d09e5dad81/plot_02_overview_skore_project.py => a71f57e7bbc20e0ad1c7726f424ae7af/plot_01_overview_skore_project.py} (100%) rename docs/latest/_downloads/{1fdf6cf5ecdefe8452c51e11c699128e/plot_02_overview_skore_project.ipynb => e1435ff93991741da29c534b3219bd7d/plot_01_overview_skore_project.ipynb} (100%) rename docs/latest/_downloads/{97b4b84f5410e1134b3cbe5e4682d2a1 => eade513547915d5577faa974f7c36c1d}/plot_01_getting_started.zip (98%) rename docs/latest/_images/{sphx_glr_plot_03_cross_validate_thumb.png => sphx_glr_plot_01_cross_validate_thumb.png} (100%) rename docs/latest/_images/{sphx_glr_plot_02_overview_skore_project_001.png => sphx_glr_plot_01_overview_skore_project_001.png} (99%) rename docs/latest/_images/{sphx_glr_plot_02_overview_skore_project_thumb.png => sphx_glr_plot_01_overview_skore_project_thumb.png} (100%) rename docs/latest/_images/{sphx_glr_plot_04_tracking_items_thumb.png => sphx_glr_plot_02_tracking_items_thumb.png} (100%) rename docs/latest/_images/{sphx_glr_plot_05_train_test_split_thumb.png => sphx_glr_plot_02_train_test_split_thumb.png} (100%) create mode 100644 docs/latest/_sources/auto_examples/00_getting_started/index.rst.txt rename docs/latest/_sources/auto_examples/{ => 00_getting_started}/plot_01_getting_started.rst.txt (91%) create mode 100644 docs/latest/_sources/auto_examples/01_track/index.rst.txt rename docs/latest/_sources/auto_examples/{plot_02_overview_skore_project.rst.txt => 01_track/plot_01_overview_skore_project.rst.txt} (98%) rename docs/latest/_sources/auto_examples/{plot_04_tracking_items.rst.txt => 01_track/plot_02_tracking_items.rst.txt} (65%) create mode 100644 docs/latest/_sources/auto_examples/02_diagnose/index.rst.txt rename docs/latest/_sources/auto_examples/{plot_03_cross_validate.rst.txt => 02_diagnose/plot_01_cross_validate.rst.txt} (50%) rename docs/latest/_sources/auto_examples/{plot_05_train_test_split.rst.txt => 02_diagnose/plot_02_train_test_split.rst.txt} (95%) create mode 100644 docs/latest/auto_examples/00_getting_started/index.html rename docs/latest/auto_examples/{ => 00_getting_started}/plot_01_getting_started.html (78%) create mode 100644 docs/latest/auto_examples/01_track/index.html rename docs/latest/auto_examples/{plot_02_overview_skore_project.html => 01_track/plot_01_overview_skore_project.html} (91%) rename docs/latest/auto_examples/{plot_04_tracking_items.html => 01_track/plot_02_tracking_items.html} (62%) create mode 100644 docs/latest/auto_examples/02_diagnose/index.html rename docs/latest/auto_examples/{plot_03_cross_validate.html => 02_diagnose/plot_01_cross_validate.html} (59%) rename docs/latest/auto_examples/{plot_05_train_test_split.html => 02_diagnose/plot_02_train_test_split.html} (80%) diff --git a/.github/actions/sphinx/build/action.yml b/.github/actions/sphinx/build/action.yml index 74af5c68c..ee5d9ff05 100644 --- a/.github/actions/sphinx/build/action.yml +++ b/.github/actions/sphinx/build/action.yml @@ -1,4 +1,11 @@ name: Build sphinx documentation + +inputs: + SPHINX_VERSION: + required: true + SPHINX_RELEASE: + required: true + runs: using: composite steps: @@ -9,4 +16,7 @@ runs: python -m pip install '.[sphinx]' - working-directory: sphinx shell: bash - run: make html + run: > + SPHINX_VERSION=${{ inputs.SPHINX_VERSION }} + SPHINX_RELEASE=${{ inputs.SPHINX_RELEASE }} + make html diff --git a/.github/actions/sphinx/deploy/action.yml b/.github/actions/sphinx/deploy/action.yml index ecb5b8c37..e6118ee0f 100644 --- a/.github/actions/sphinx/deploy/action.yml +++ b/.github/actions/sphinx/deploy/action.yml @@ -1,19 +1,38 @@ name: Deploy sphinx documentation -permissions: - contents: write + +inputs: + CONFIGURATION: + required: true + ACTION: + required: false + default: sync + type: choice + options: + - copy + - sync + PROVIDER: + required: false + default: scaleway + BUCKET: + required: false + default: prod-probabl-skore + SOURCE: + required: true + DESTINATION: + required: true + runs: using: composite steps: - shell: bash run: | - rm -rf docs/latest - mv sphinx/build/html docs/latest + sudo apt-get update + sudo apt-get install -y rclone + - shell: bash + run: echo "${{ inputs.CONFIGURATION }}" > rclone.configuration - shell: bash run: | - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git config commit.cleanup 'verbatim' - - git add docs/latest - git commit -m $'docs: Build documentation triggered by ${{ github.sha }}\n\n\nskip-checks:true' - git push + rclone --config rclone.configuration \ + ${{ inputs.ACTION }} \ + ${{ inputs.SOURCE }} \ + ${{ inputs.PROVIDER }}:${{ inputs.BUCKET }}/${{ inputs.DESTINATION }} diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index b602fc874..73b1a5e2f 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -1,5 +1,51 @@ name: Sphinx + +# **How it works** +# ================ +# +# After each __commit__ on the `main` branch, the documentation is built and deployed on the `S3:dev/` directory. +# After each __release__, the documentation is built and deployed to the `S3:version/` directory, the version being +# a subpart of the tag `MAJOR.MINOR.BUGFIX`: `MAJOR.MINOR`. +# +# For instance, with the following timeline: +# +# dev/ dev/ dev/ dev/ dev/ +# 0.1/ 0.2/ +# main -- x -- x -- x -- x -- x -- > +# | | +# tag 0.1 0.2 +# +# The S3 bucket looks like: +# . +# ├── 0.1/ +# ├── 0.2/ +# ├── dev/ +# ├── index.html +# └── versions.json +# +# **Q&A** +# ======= +# +# ### `dev/`, why? +# It contains the most up-to-date documentation, i.e. the documentation of code that is not released but committed on the main branch. +# +# ### Version the documentation on `MAJOR.MINOR, why not on `MAJOR`? +# Currently, we add new features at a minor level. This way, we can separate documentation between two features. +# +# ### Only on release (not on release-candidate), why? +# The release-candidates are documented in the `dev/` directory. We don't want to create noise with explicit directory for such tags. +# +# ### How to change an old version of the documentation? +# You can create tags wherever you want, i.e. on separate branches. +# For example, you can create a branch from an old tag (`0.1.5`), modify the documentation and create a new tag (`0.1.6`). +# The corresponding documentation will be automatically updated (`0.1`). +# +# **Side-notes** +# ============== +# +# Only the 10 latest versions are listed in sphinx version-switcher to avoid overloading, but the bucket remains unchanged. + on: pull_request: paths: @@ -17,22 +63,131 @@ on: - 'examples/**' - 'sphinx/**' - 'skore/**' + release: + types: [released] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - sphinx: + sphinx-version: runs-on: ubuntu-latest + outputs: + SPHINX_VERSION: ${{ steps.sphinx-version.outputs.SPHINX_VERSION }} + SPHINX_RELEASE: ${{ steps.sphinx-version.outputs.SPHINX_RELEASE }} + steps: + - shell: bash + id: sphinx-version + run: | + set -u + + if [[ "${GITHUB_EVENT_NAME}" != "release" ]]; then + echo "SPHINX_VERSION=dev" >> "${GITHUB_OUTPUT}" + echo "SPHINX_RELEASE=0.0.0+dev" >> "${GITHUB_OUTPUT}" + exit 0 + fi + + set -e + + if [[ "${GITHUB_REF_NAME}" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)?$ ]]; then + echo "SPHINX_VERSION=${BASH_REMATCH[1]}.${BASH_REMATCH[2]}" >> "${GITHUB_OUTPUT}" + echo "SPHINX_RELEASE=${GITHUB_REF_NAME}" >> "${GITHUB_OUTPUT}" + fi + + sphinx-build: + runs-on: ubuntu-latest + needs: sphinx-version steps: - uses: actions/checkout@v4 - with: - ssh-key: ${{ secrets.DEPLOY_KEY }} - uses: actions/setup-python@v5 with: python-version: '3.12' cache: 'pip' - uses: ./.github/actions/sphinx/build - - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} - uses: ./.github/actions/sphinx/deploy + with: + SPHINX_VERSION: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }} + SPHINX_RELEASE: ${{ needs.sphinx-version.outputs.SPHINX_RELEASE }} + - uses: actions/upload-artifact@v4 + with: + name: sphinx-html-artifact + path: sphinx/build/html/ + + sphinx-deploy-html: + runs-on: ubuntu-latest + if: ${{ (github.event_name == 'release') || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} + needs: [sphinx-version, sphinx-build] + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: sphinx-html-artifact + path: html/ + - uses: ./.github/actions/sphinx/deploy + with: + CONFIGURATION: ${{ secrets.RCLONE_CONFIG_DOCS }} + SOURCE: html/ + DESTINATION: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }}/ + + sphinx-deploy-root-files: + runs-on: ubuntu-latest + if: ${{ github.event_name == 'release' }} + needs: [sphinx-version, sphinx-build, sphinx-deploy-html] + steps: + - uses: actions/checkout@v4 + - shell: python + run: | + import os + import requests + import operator + import json + + url = "https://skore.probabl.ai" + current = os.environ["CURRENT"] + + response = requests.get(f"{url}/versions.json") + response.raise_for_status() + + history = set(map(operator.itemgetter("version"), response.json())) - {"dev"} | {current} + history = sorted(history, key=lambda x: float(x), reverse=True)[:10] + + new = [ + { + "name": version, + "version": version, + "url": f"{url}/{version}/", + "preferred": i == 1, + } + for i, version in enumerate(["dev"] + history) + ] + + os.mkdir("artifacts") + + with open("artifacts/versions.json", "w", encoding="utf-8") as file: + json.dump(new, file, ensure_ascii=False, indent=4) + + with open("artifacts/index.html", "w", encoding="utf-8") as file: + file.write( + f""" + + + + """ + ) + env: + CURRENT: ${{ needs.sphinx-version.outputs.SPHINX_VERSION }} + - uses: ./.github/actions/sphinx/deploy + with: + CONFIGURATION: ${{ secrets.RCLONE_CONFIG_DOCS }} + ACTION: copy + SOURCE: artifacts/ + DESTINATION: + + sphinx-clean: + runs-on: ubuntu-latest + if: always() + needs: [sphinx-version, sphinx-build, sphinx-deploy-html, sphinx-deploy-root-files] + steps: + - uses: geekyeggo/delete-artifact@v5 + with: + name: sphinx-html-artifact diff --git a/docs/latest/_downloads/14e353ee268e214967a45032a868744b/plot_05_train_test_split.py b/docs/latest/_downloads/024736589b9c3fa37859d9272c9a8cdb/plot_02_train_test_split.py similarity index 100% rename from docs/latest/_downloads/14e353ee268e214967a45032a868744b/plot_05_train_test_split.py rename to docs/latest/_downloads/024736589b9c3fa37859d9272c9a8cdb/plot_02_train_test_split.py diff --git a/docs/latest/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip b/docs/latest/_downloads/07fcc19ba03226cd3d83d4e40ec44385/auto_examples_python.zip index e3930a598537e83d13106bec2dc49ae94108905b..6ce9108ccebed481473e172a7cc2a5ac1ec30d06 100644 GIT binary patch delta 619 zcmdno#k97Y$uPj1nMH&F1m4>-YNPm+%*6D({Nhxo(T1C4{6oamKLZu( zJ-c=#Qig#6gw?SsHrl*THebe`kx7IZw?Bb8!C*-vh{EFQiE>i)0p18humu3b2nL2F zjcb4&MGp>0;DAChvm`aQSg)WG-8}SQLYUWR1T>EyHGB;xcc)1?qMLypcnC8t`(q8t z$$MJl;<1G!LZ@FkHl0Qw4`t@Xm!uY##1|LjWR`%v#L5QJ$O?q385tPfG=q2mAt0gh delta 491 zcmZ46&9u3TNiM*fnMH&F1Vq|uBaO@ZS0~CcFo3WWP;8@NtE{vHP(tt7wJVV_3=AMF z4U{Oz$uEgFFx_0Ao-Z>wAe}>69H?l4MylpipkW{^30GvY`IhWP5wL;{3o;We#2FYs z7@@#;GfO~-I9P$7L}DWs&~6Y`gqvWrdA*UE?BsXNTuRs+2~-CLOBzAcL_?|i0B=Sn z5oUzhG5027^Y8vph%6=yWus2USJXF1`w73Dk#XwFNrrW h+&o2`MTHrtdh%>*RYt?f2d(9pfyyU80`oX*v;lEj8jAn` delta 88 zcmdm7vAKdbz?+#xgaHJ^+iEBBiZdE-R1FcA267^2niQx$R%T!TVHu!;f}H%4cmw0j eQ^Z+Rn1Ko=&$d=&G@g9WS`N&61mZ*X$D?3SMUr=XY0AW>-dc*jVqQvBE{eqnQl6V87$?|VRH_wW@r4Clj zaAa~}mjeR>2m>uZS8cd?&8n3SlYMkK)IS5wo@r8``dFEP0faR`s*U1PG85DD@{3cU z#v5+#Z(~vcEB?MUU*;Cj#UQMORk6|LeBI9m_KZv-%((pv)CmSl8bK6x-)kCS^EpHx z1H+QWSWwtuhJzwl8+s5Rv=xM6XfvF=W|gdCfH%U;*un*2gzGe{p)|R_O>}bI8y-`T lZuEdc=+4`PO}EkHd|h#|0B=?{kV;k{+{MViFyS?b2LQ(WqQC$E delta 447 zcmaEGi}~42X1M@wW)=|!5D;&xjm+2AOXk;QU;trRpx8!3GhJy3pv3pB`7*Z*7#KiU z4k%HOlV1{VV7ht!uFnRO3wCjU6)8JOW?xWeU;tqmxFVCy-Ma79r9sBeG$~Mhtjxdw z!UzS%o6Dv#selzQ9GP6$<-ouI!YXhRj3(E=k=?vIw8ue*kx7IZw{w9yz+g!uh?;!y zwWcOE$3qk`Ff3{G0{Ro`mC5sWiJJy^BP;;vME4OwXF?oIr^#fUH;S6ryoXSo)do{- kJozqEHM(CBs@qq=RD*mjFT%5&X1HmSi=lF|lefi*0RRktADsXI delta 112 zcmX@Jm+{PAM&1B#W)=|!5D;&xoyaTBXf!!bR$`;An5;BVAd=z8^6oGL_%U_oVoHzSh>Gu*Vv#ZWof$=l+@0D!6;K>z>% diff --git a/docs/latest/_downloads/cdd7bc0df44925960cbfd8a4588515de/plot_05_train_test_split.zip b/docs/latest/_downloads/9ecad9d310c18cfcb34e6f41dc43832c/plot_02_train_test_split.zip similarity index 98% rename from docs/latest/_downloads/cdd7bc0df44925960cbfd8a4588515de/plot_05_train_test_split.zip rename to docs/latest/_downloads/9ecad9d310c18cfcb34e6f41dc43832c/plot_02_train_test_split.zip index 85846ff480b6f5f27a1df909a7db909e9673b4df..e254dd982663435b003965c853b57700556a98f2 100644 GIT binary patch delta 71 zcmcaShw<_pM&1B#W)=|!5cq7@G?7=F(P*P;xePOqGkLxYkhgie%wGdAce}4DqtWEM Pz6v1TBtH;G%}*BqBAXXY delta 71 zcmcaShw<_pM&1B#W)=|!5RhoAoyaTBXu46gT!tCQnLJ+x$lJVK=C1*myWLln(RA`% PUj-0vk{^hp=BEn))6o?9 diff --git a/docs/latest/_downloads/b10f2525b5ecaf48aa269d4d66baefe0/plot_04_tracking_items.zip b/docs/latest/_downloads/a3a1956f20f72c86db7fe85f16458c1e/plot_02_tracking_items.zip similarity index 98% rename from docs/latest/_downloads/b10f2525b5ecaf48aa269d4d66baefe0/plot_04_tracking_items.zip rename to docs/latest/_downloads/a3a1956f20f72c86db7fe85f16458c1e/plot_02_tracking_items.zip index d715facd4a2b79651253a1c2431978b1d11580ff..6e27b5a045bbf1eb248947360054ccf7c184084e 100644 GIT binary patch delta 92 zcmexc^|y*Qz?+#xgaHIT*)>h%6=yWssJc-^8pw%Mc9P7#pw7Sm!ZJVw1v&X8@diel jKZ<-*X9g;m{M1I3(P%QatsI!AV+-Pa6cL@AZYu@=ED{|J delta 92 zcmexc^|y*Qz?+#xgaHJ^+iEBBiZhyQRNW{dEzwpRsq7?~eLH5clm-;oPZB1kRD+BH3O(%r_g;wx%)u6#@XE C>=Bdz diff --git a/docs/latest/_images/sphx_glr_plot_02_overview_skore_project_thumb.png b/docs/latest/_images/sphx_glr_plot_01_overview_skore_project_thumb.png similarity index 100% rename from docs/latest/_images/sphx_glr_plot_02_overview_skore_project_thumb.png rename to docs/latest/_images/sphx_glr_plot_01_overview_skore_project_thumb.png diff --git a/docs/latest/_images/sphx_glr_plot_04_tracking_items_thumb.png b/docs/latest/_images/sphx_glr_plot_02_tracking_items_thumb.png similarity index 100% rename from docs/latest/_images/sphx_glr_plot_04_tracking_items_thumb.png rename to docs/latest/_images/sphx_glr_plot_02_tracking_items_thumb.png diff --git a/docs/latest/_images/sphx_glr_plot_05_train_test_split_thumb.png b/docs/latest/_images/sphx_glr_plot_02_train_test_split_thumb.png similarity index 100% rename from docs/latest/_images/sphx_glr_plot_05_train_test_split_thumb.png rename to docs/latest/_images/sphx_glr_plot_02_train_test_split_thumb.png diff --git a/docs/latest/_sources/auto_examples/00_getting_started/index.rst.txt b/docs/latest/_sources/auto_examples/00_getting_started/index.rst.txt new file mode 100644 index 000000000..6cc17a494 --- /dev/null +++ b/docs/latest/_sources/auto_examples/00_getting_started/index.rst.txt @@ -0,0 +1,47 @@ + + +.. _sphx_glr_auto_examples_00_getting_started: + +Getting started +--------------- + +We recommend first having a look at this example that serves as an overall and gentle +introduction to skore. + + + +.. raw:: html + +
+ +.. thumbnail-parent-div-open + +.. raw:: html + +
+ +.. only:: html + + .. image:: /auto_examples/00_getting_started/images/thumb/sphx_glr_plot_01_getting_started_thumb.png + :alt: + + :ref:`sphx_glr_auto_examples_00_getting_started_plot_01_getting_started.py` + +.. raw:: html + +
Getting started with skore
+
+ + +.. thumbnail-parent-div-close + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /auto_examples/00_getting_started/plot_01_getting_started + diff --git a/docs/latest/_sources/auto_examples/plot_01_getting_started.rst.txt b/docs/latest/_sources/auto_examples/00_getting_started/plot_01_getting_started.rst.txt similarity index 91% rename from docs/latest/_sources/auto_examples/plot_01_getting_started.rst.txt rename to docs/latest/_sources/auto_examples/00_getting_started/plot_01_getting_started.rst.txt index 682f4bcfa..2e3839a96 100644 --- a/docs/latest/_sources/auto_examples/plot_01_getting_started.rst.txt +++ b/docs/latest/_sources/auto_examples/00_getting_started/plot_01_getting_started.rst.txt @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/plot_01_getting_started.py" +.. "auto_examples/00_getting_started/plot_01_getting_started.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_plot_01_getting_started.py: +.. _sphx_glr_auto_examples_00_getting_started_plot_01_getting_started.py: .. _example_getting_started: @@ -91,12 +91,12 @@ We create and load the skore project from this temporary directory: .. code-block:: none - [11/29/24 16:48:41] Project create.py:148 + [12/02/24 07:55:31] Project create.py:148 file '/tmp/sk ore_exam - ple_lfp6 - 7wcv/my_ + ple_7jdu + 46nf/my_ project. skore' was @@ -717,9 +717,9 @@ plot: -.. image-sg:: /auto_examples/images/sphx_glr_plot_01_getting_started_001.png +.. image-sg:: /auto_examples/00_getting_started/images/sphx_glr_plot_01_getting_started_001.png :alt: Ridge regression - :srcset: /auto_examples/images/sphx_glr_plot_01_getting_started_001.png + :srcset: /auto_examples/00_getting_started/images/sphx_glr_plot_01_getting_started_001.png :class: sphx-glr-single-img @@ -836,7 +836,7 @@ a ``cross_validation`` item with a plotly chart in our project.
-
+


@@ -933,10 +933,10 @@ Removing the temporary directory: .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 5.282 seconds) + **Total running time of the script:** (0 minutes 5.297 seconds) -.. _sphx_glr_download_auto_examples_plot_01_getting_started.py: +.. _sphx_glr_download_auto_examples_00_getting_started_plot_01_getting_started.py: .. only:: html diff --git a/docs/latest/_sources/auto_examples/01_track/index.rst.txt b/docs/latest/_sources/auto_examples/01_track/index.rst.txt new file mode 100644 index 000000000..53e1d097d --- /dev/null +++ b/docs/latest/_sources/auto_examples/01_track/index.rst.txt @@ -0,0 +1,64 @@ + + +.. _sphx_glr_auto_examples_01_track: + +Track +----- + +These examples illustrate the skore Project and UI. + + + +.. raw:: html + +
+ +.. thumbnail-parent-div-open + +.. raw:: html + +
+ +.. only:: html + + .. image:: /auto_examples/01_track/images/thumb/sphx_glr_plot_01_overview_skore_project_thumb.png + :alt: + + :ref:`sphx_glr_auto_examples_01_track_plot_01_overview_skore_project.py` + +.. raw:: html + +
Overview of the skore project
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /auto_examples/01_track/images/thumb/sphx_glr_plot_02_tracking_items_thumb.png + :alt: + + :ref:`sphx_glr_auto_examples_01_track_plot_02_tracking_items.py` + +.. raw:: html + +
Tracking items using their history
+
+ + +.. thumbnail-parent-div-close + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /auto_examples/01_track/plot_01_overview_skore_project + /auto_examples/01_track/plot_02_tracking_items + diff --git a/docs/latest/_sources/auto_examples/plot_02_overview_skore_project.rst.txt b/docs/latest/_sources/auto_examples/01_track/plot_01_overview_skore_project.rst.txt similarity index 98% rename from docs/latest/_sources/auto_examples/plot_02_overview_skore_project.rst.txt rename to docs/latest/_sources/auto_examples/01_track/plot_01_overview_skore_project.rst.txt index ec17726db..8f8ea7973 100644 --- a/docs/latest/_sources/auto_examples/plot_02_overview_skore_project.rst.txt +++ b/docs/latest/_sources/auto_examples/01_track/plot_01_overview_skore_project.rst.txt @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/plot_02_overview_skore_project.py" +.. "auto_examples/01_track/plot_01_overview_skore_project.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_plot_02_overview_skore_project.py: +.. _sphx_glr_auto_examples_01_track_plot_01_overview_skore_project.py: .. _example_overview_skore_project: @@ -74,12 +74,12 @@ We create and load the skore project from this temporary directory: .. code-block:: none - [11/29/24 16:48:46] Project create.py:148 + [12/02/24 07:55:36] Project create.py:148 file '/tmp/sk ore_exam - ple_xudu - 7p_p/my_ + ple_g4dh + y3_2/my_ project. skore' was @@ -463,9 +463,9 @@ Numpy array: .. code-block:: none - array([[ 0.99281681, 0.44219449, 0.65533057], - [-0.24864296, 1.10948341, -2.10146096], - [ 0.44376087, -1.53459009, 0.38465483]]) + array([[ 1.8312195 , -0.35893268, 0.94549297], + [ 1.27768204, 0.62375238, 1.34861347], + [-1.01895005, 0.46187983, -0.99992579]]) @@ -519,43 +519,43 @@ Pandas data frame: 0 - -0.332081 - -1.107519 - -0.429733 - -0.399678 - -0.936569 + -0.958900 + -0.487634 + 1.441156 + 1.791905 + -0.833153 1 - 2.643440 - -0.678609 - -0.602022 - -0.218836 - 0.909255 + -1.075953 + -2.721744 + -0.149904 + 2.105151 + 0.385449 2 - 0.969581 - -0.520597 - 1.432879 - -0.441118 - -1.371724 + 1.979321 + -0.454063 + -1.440137 + 0.332280 + 2.741180 3 - 0.366999 - -0.672715 - -1.113925 - -0.818641 - 0.657160 + -1.322320 + -0.447686 + 0.525607 + -1.104641 + 0.388101 4 - 0.187187 - -0.707184 - 1.455580 - 0.532581 - -0.112769 + -0.527214 + -2.414307 + -0.061088 + -1.058985 + 0.296288 @@ -593,7 +593,7 @@ Polars data frame: white-space: pre-wrap; } - shape: (5, 5)
column_0column_1column_2column_3column_4
f64f64f64f64f64
0.8282421.210976-1.651619-1.5664581.141409
-1.257238-0.243915-1.164194-0.177233-0.944327
1.6915110.65013-1.2615720.493694-0.229308
0.512165-0.0104040.1853860.1319881.89348
-0.928704-0.365251-0.512659-1.9649440.827703
+ shape: (5, 5)
column_0column_1column_2column_3column_4
f64f64f64f64f64
-2.016784-1.578340.486351-0.046798-0.196609
0.749376-0.0552530.5081111.474227-0.162663
0.352716-0.4316170.086720.749166-0.229909
1.3516041.2398780.5582780.6178670.436303
2.1371330.0399240.1658320.4098781.445417


@@ -633,9 +633,9 @@ Matplotlib figure: -.. image-sg:: /auto_examples/images/sphx_glr_plot_02_overview_skore_project_001.png +.. image-sg:: /auto_examples/01_track/images/sphx_glr_plot_01_overview_skore_project_001.png :alt: Simple Plot - :srcset: /auto_examples/images/sphx_glr_plot_02_overview_skore_project_001.png + :srcset: /auto_examples/01_track/images/sphx_glr_plot_01_overview_skore_project_001.png :class: sphx-glr-single-img @@ -718,7 +718,7 @@ Plotly figure:
-
+


@@ -760,10 +760,10 @@ Animated Plotly figure:
-

@@ -2126,10 +2126,10 @@ Removing the temporary directory: .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.813 seconds) + **Total running time of the script:** (0 minutes 0.852 seconds) -.. _sphx_glr_download_auto_examples_plot_02_overview_skore_project.py: +.. _sphx_glr_download_auto_examples_01_track_plot_01_overview_skore_project.py: .. only:: html @@ -2137,15 +2137,15 @@ Removing the temporary directory: .. container:: sphx-glr-download sphx-glr-download-jupyter - :download:`Download Jupyter notebook: plot_02_overview_skore_project.ipynb ` + :download:`Download Jupyter notebook: plot_01_overview_skore_project.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python - :download:`Download Python source code: plot_02_overview_skore_project.py ` + :download:`Download Python source code: plot_01_overview_skore_project.py ` .. container:: sphx-glr-download sphx-glr-download-zip - :download:`Download zipped: plot_02_overview_skore_project.zip ` + :download:`Download zipped: plot_01_overview_skore_project.zip ` .. only:: html diff --git a/docs/latest/_sources/auto_examples/plot_04_tracking_items.rst.txt b/docs/latest/_sources/auto_examples/01_track/plot_02_tracking_items.rst.txt similarity index 65% rename from docs/latest/_sources/auto_examples/plot_04_tracking_items.rst.txt rename to docs/latest/_sources/auto_examples/01_track/plot_02_tracking_items.rst.txt index 5913f523c..93cd67f16 100644 --- a/docs/latest/_sources/auto_examples/plot_04_tracking_items.rst.txt +++ b/docs/latest/_sources/auto_examples/01_track/plot_02_tracking_items.rst.txt @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/plot_04_tracking_items.py" +.. "auto_examples/01_track/plot_02_tracking_items.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_plot_04_tracking_items.py: +.. _sphx_glr_auto_examples_01_track_plot_02_tracking_items.py: .. _example_historization_items: @@ -74,12 +74,12 @@ We create and load the skore project from this temporary directory: .. code-block:: none - [11/29/24 16:48:48] Project create.py:148 + [12/02/24 07:55:37] Project create.py:148 file '/tmp/sk ore_exam - ple_osia - bcs7/my_ + ple_pzs4 + u8p_/my_ project. skore' was @@ -176,8 +176,8 @@ We can print the first history (first iteration) of this item: PrimitiveItem(...) 4 - 2024-11-29T16:48:48.090006+00:00 - 2024-11-29T16:48:48.090006+00:00 + 2024-12-02T07:55:37.444899+00:00 + 2024-12-02T07:55:37.444899+00:00 @@ -244,22 +244,22 @@ Let us construct a dataframe with the values and last updated times: 0 0 4 - 2024-11-29T16:48:48.090006+00:00 - 2024-11-29T16:48:48.090006+00:00 + 2024-12-02T07:55:37.444899+00:00 + 2024-12-02T07:55:37.444899+00:00 1 1 9 - 2024-11-29T16:48:48.090006+00:00 - 2024-11-29T16:48:48.190978+00:00 + 2024-12-02T07:55:37.444899+00:00 + 2024-12-02T07:55:37.546343+00:00 2 2 16 - 2024-11-29T16:48:48.090006+00:00 - 2024-11-29T16:48:48.291883+00:00 + 2024-12-02T07:55:37.444899+00:00 + 2024-12-02T07:55:37.647250+00:00 @@ -307,7 +307,7 @@ We can now track the value of the item over time:
-
+


@@ -388,7 +388,7 @@ cross-validations in separate cells and forgot to store the intermediate results .. code-block:: none - {'fit_time': array([0.00070858, 0.00060725, 0.0005846 , 0.00058293, 0.00059032]), 'score_time': array([0.00122952, 0.00109863, 0.0010972 , 0.00108743, 0.00108004]), 'test_score': array([0.37120575, 0.35192712, 0.23584637, 0.34640053, 0.35467375])} + {'fit_time': array([0.00077963, 0.00063825, 0.00061035, 0.00062108, 0.00059438]), 'score_time': array([0.00131917, 0.00113201, 0.00115156, 0.00110245, 0.00114775]), 'test_score': array([0.37120575, 0.35192712, 0.23584637, 0.34640053, 0.35467375])} @@ -407,7 +407,7 @@ cross-validations in separate cells and forgot to store the intermediate results .. code-block:: none - {'fit_time': array([0.00070477, 0.00060415, 0.00058484, 0.00059366, 0.00057411]), 'score_time': array([0.00118732, 0.00108862, 0.0010941 , 0.00108504, 0.00105906]), 'test_score': array([0.29828675, 0.2241492 , 0.15480127, 0.25519733, 0.17108715])} + {'fit_time': array([0.00074482, 0.00060129, 0.00063109, 0.00059485, 0.00058389]), 'score_time': array([0.00118446, 0.00110936, 0.00111365, 0.00110626, 0.00114036]), 'test_score': array([0.29828675, 0.2241492 , 0.15480127, 0.25519733, 0.17108715])} @@ -426,7 +426,7 @@ cross-validations in separate cells and forgot to store the intermediate results .. code-block:: none - {'fit_time': array([0.00072742, 0.0006125 , 0.00059724, 0.0005827 , 0.0005796 ]), 'score_time': array([0.00117397, 0.00111151, 0.00116515, 0.00107336, 0.00109792]), 'test_score': array([ 0.0126695 , -0.00513875, -0.20965344, -0.05184674, -0.15853853])} + {'fit_time': array([0.00074697, 0.00059772, 0.00059104, 0.00058818, 0.00058746]), 'score_time': array([0.00118518, 0.0011394 , 0.00110078, 0.00112367, 0.00109386]), 'test_score': array([ 0.0126695 , -0.00513875, -0.20965344, -0.05184674, -0.15853853])} @@ -452,7 +452,7 @@ cross-validation run (on all splits):
-
+


@@ -490,10 +490,10 @@ Removing the temporary directory: .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.373 seconds) + **Total running time of the script:** (0 minutes 0.383 seconds) -.. _sphx_glr_download_auto_examples_plot_04_tracking_items.py: +.. _sphx_glr_download_auto_examples_01_track_plot_02_tracking_items.py: .. only:: html @@ -501,15 +501,15 @@ Removing the temporary directory: .. container:: sphx-glr-download sphx-glr-download-jupyter - :download:`Download Jupyter notebook: plot_04_tracking_items.ipynb ` + :download:`Download Jupyter notebook: plot_02_tracking_items.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python - :download:`Download Python source code: plot_04_tracking_items.py ` + :download:`Download Python source code: plot_02_tracking_items.py ` .. container:: sphx-glr-download sphx-glr-download-zip - :download:`Download zipped: plot_04_tracking_items.zip ` + :download:`Download zipped: plot_02_tracking_items.zip ` .. only:: html diff --git a/docs/latest/_sources/auto_examples/02_diagnose/index.rst.txt b/docs/latest/_sources/auto_examples/02_diagnose/index.rst.txt new file mode 100644 index 000000000..8d2d7cf5d --- /dev/null +++ b/docs/latest/_sources/auto_examples/02_diagnose/index.rst.txt @@ -0,0 +1,65 @@ + + +.. _sphx_glr_auto_examples_02_diagnose: + +Diagnose +-------- + +These examples illustrate how skore can help data scientists to improve their +machine learning modelling thanks to diagnostics. + + + +.. raw:: html + +
+ +.. thumbnail-parent-div-open + +.. raw:: html + +
+ +.. only:: html + + .. image:: /auto_examples/02_diagnose/images/thumb/sphx_glr_plot_01_cross_validate_thumb.png + :alt: + + :ref:`sphx_glr_auto_examples_02_diagnose_plot_01_cross_validate.py` + +.. raw:: html + +
Enhancing cross-validation
+
+ + +.. raw:: html + +
+ +.. only:: html + + .. image:: /auto_examples/02_diagnose/images/thumb/sphx_glr_plot_02_train_test_split_thumb.png + :alt: + + :ref:`sphx_glr_auto_examples_02_diagnose_plot_02_train_test_split.py` + +.. raw:: html + +
Enhancing train-test split
+
+ + +.. thumbnail-parent-div-close + +.. raw:: html + +
+ + +.. toctree:: + :hidden: + + /auto_examples/02_diagnose/plot_01_cross_validate + /auto_examples/02_diagnose/plot_02_train_test_split + diff --git a/docs/latest/_sources/auto_examples/plot_03_cross_validate.rst.txt b/docs/latest/_sources/auto_examples/02_diagnose/plot_01_cross_validate.rst.txt similarity index 50% rename from docs/latest/_sources/auto_examples/plot_03_cross_validate.rst.txt rename to docs/latest/_sources/auto_examples/02_diagnose/plot_01_cross_validate.rst.txt index 30017c7e0..823dc7efb 100644 --- a/docs/latest/_sources/auto_examples/plot_03_cross_validate.rst.txt +++ b/docs/latest/_sources/auto_examples/02_diagnose/plot_01_cross_validate.rst.txt @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/plot_03_cross_validate.py" +.. "auto_examples/02_diagnose/plot_01_cross_validate.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_plot_03_cross_validate.py: +.. _sphx_glr_auto_examples_02_diagnose_plot_01_cross_validate.py: .. _example_cross_validate: @@ -74,12 +74,12 @@ We create and load the skore project from this temporary directory: .. code-block:: none - [11/29/24 16:48:47] Project create.py:148 + Project create.py:148 file '/tmp/sk ore_exam - ple_gkoc - 23x4/my_ + ple_k89d + nf6t/my_ project. skore' was @@ -291,7 +291,7 @@ Let us continue with the same use case.
-
+


@@ -374,7 +374,7 @@ running another unrelated cross-validation:
-
+


@@ -410,7 +410,7 @@ Removing the temporary directory: **Total running time of the script:** (0 minutes 0.158 seconds) -.. _sphx_glr_download_auto_examples_plot_03_cross_validate.py: +.. _sphx_glr_download_auto_examples_02_diagnose_plot_01_cross_validate.py: .. only:: html @@ -418,15 +418,15 @@ Removing the temporary directory: .. container:: sphx-glr-download sphx-glr-download-jupyter - :download:`Download Jupyter notebook: plot_03_cross_validate.ipynb ` + :download:`Download Jupyter notebook: plot_01_cross_validate.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python - :download:`Download Python source code: plot_03_cross_validate.py ` + :download:`Download Python source code: plot_01_cross_validate.py ` .. container:: sphx-glr-download sphx-glr-download-zip - :download:`Download zipped: plot_03_cross_validate.zip ` + :download:`Download zipped: plot_01_cross_validate.zip ` .. only:: html diff --git a/docs/latest/_sources/auto_examples/plot_05_train_test_split.rst.txt b/docs/latest/_sources/auto_examples/02_diagnose/plot_02_train_test_split.rst.txt similarity index 95% rename from docs/latest/_sources/auto_examples/plot_05_train_test_split.rst.txt rename to docs/latest/_sources/auto_examples/02_diagnose/plot_02_train_test_split.rst.txt index 08bbc05b9..6b7e107f8 100644 --- a/docs/latest/_sources/auto_examples/plot_05_train_test_split.rst.txt +++ b/docs/latest/_sources/auto_examples/02_diagnose/plot_02_train_test_split.rst.txt @@ -2,7 +2,7 @@ .. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: -.. "auto_examples/plot_05_train_test_split.py" +.. "auto_examples/02_diagnose/plot_02_train_test_split.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html @@ -10,12 +10,12 @@ .. note:: :class: sphx-glr-download-link-note - :ref:`Go to the end ` + :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_plot_05_train_test_split.py: +.. _sphx_glr_auto_examples_02_diagnose_plot_02_train_test_split.py: .. _example_train_test_split: @@ -74,12 +74,12 @@ We create and load the skore project from this temporary directory: .. code-block:: none - Project create.py:148 + [12/02/24 07:55:38] Project create.py:148 file '/tmp/sk ore_exam - ple_2adr - kfbh/my_ + ple_t1iz + n79h/my_ project. skore' was @@ -584,10 +584,10 @@ Removing the temporary directory: .. rst-class:: sphx-glr-timing - **Total running time of the script:** (0 minutes 0.039 seconds) + **Total running time of the script:** (0 minutes 0.043 seconds) -.. _sphx_glr_download_auto_examples_plot_05_train_test_split.py: +.. _sphx_glr_download_auto_examples_02_diagnose_plot_02_train_test_split.py: .. only:: html @@ -595,15 +595,15 @@ Removing the temporary directory: .. container:: sphx-glr-download sphx-glr-download-jupyter - :download:`Download Jupyter notebook: plot_05_train_test_split.ipynb ` + :download:`Download Jupyter notebook: plot_02_train_test_split.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python - :download:`Download Python source code: plot_05_train_test_split.py ` + :download:`Download Python source code: plot_02_train_test_split.py ` .. container:: sphx-glr-download sphx-glr-download-zip - :download:`Download zipped: plot_05_train_test_split.zip ` + :download:`Download zipped: plot_02_train_test_split.zip ` .. only:: html diff --git a/docs/latest/_sources/auto_examples/index.rst.txt b/docs/latest/_sources/auto_examples/index.rst.txt index e3abb0b1f..a19eb9b34 100644 --- a/docs/latest/_sources/auto_examples/index.rst.txt +++ b/docs/latest/_sources/auto_examples/index.rst.txt @@ -8,6 +8,34 @@ Examples Below is a gallery of narrated notebook examples on how and why to use skore. They also serve as our user guide. +.. toctree:: + :maxdepth: 1 + :caption: Contents: + + 00_getting_started/README + 01_track/README + 02_diagnose/README + + + +.. raw:: html + +
+ +.. thumbnail-parent-div-open + +.. thumbnail-parent-div-close + +.. raw:: html + +
+ +Getting started +--------------- + +We recommend first having a look at this example that serves as an overall and gentle +introduction to skore. + .. raw:: html @@ -22,10 +50,10 @@ They also serve as our user guide. .. only:: html - .. image:: /auto_examples/images/thumb/sphx_glr_plot_01_getting_started_thumb.png + .. image:: /auto_examples/00_getting_started/images/thumb/sphx_glr_plot_01_getting_started_thumb.png :alt: - :ref:`sphx_glr_auto_examples_plot_01_getting_started.py` + :ref:`sphx_glr_auto_examples_00_getting_started_plot_01_getting_started.py` .. raw:: html @@ -33,16 +61,35 @@ They also serve as our user guide. +.. thumbnail-parent-div-close + +.. raw:: html + + + +Track +----- + +These examples illustrate the skore Project and UI. + + + +.. raw:: html + +
+ +.. thumbnail-parent-div-open + .. raw:: html
.. only:: html - .. image:: /auto_examples/images/thumb/sphx_glr_plot_02_overview_skore_project_thumb.png + .. image:: /auto_examples/01_track/images/thumb/sphx_glr_plot_01_overview_skore_project_thumb.png :alt: - :ref:`sphx_glr_auto_examples_plot_02_overview_skore_project.py` + :ref:`sphx_glr_auto_examples_01_track_plot_01_overview_skore_project.py` .. raw:: html @@ -52,35 +99,55 @@ They also serve as our user guide. .. raw:: html -
+
.. only:: html - .. image:: /auto_examples/images/thumb/sphx_glr_plot_03_cross_validate_thumb.png + .. image:: /auto_examples/01_track/images/thumb/sphx_glr_plot_02_tracking_items_thumb.png :alt: - :ref:`sphx_glr_auto_examples_plot_03_cross_validate.py` + :ref:`sphx_glr_auto_examples_01_track_plot_02_tracking_items.py` .. raw:: html -
Enhancing cross-validation
+
Tracking items using their history
+.. thumbnail-parent-div-close + .. raw:: html -
+
+ +Diagnose +-------- + +These examples illustrate how skore can help data scientists to improve their +machine learning modelling thanks to diagnostics. + + + +.. raw:: html + +
+ +.. thumbnail-parent-div-open + +.. raw:: html + +
.. only:: html - .. image:: /auto_examples/images/thumb/sphx_glr_plot_04_tracking_items_thumb.png + .. image:: /auto_examples/02_diagnose/images/thumb/sphx_glr_plot_01_cross_validate_thumb.png :alt: - :ref:`sphx_glr_auto_examples_plot_04_tracking_items.py` + :ref:`sphx_glr_auto_examples_02_diagnose_plot_01_cross_validate.py` .. raw:: html -
Tracking items using their history
+
Enhancing cross-validation
@@ -90,10 +157,10 @@ They also serve as our user guide. .. only:: html - .. image:: /auto_examples/images/thumb/sphx_glr_plot_05_train_test_split_thumb.png + .. image:: /auto_examples/02_diagnose/images/thumb/sphx_glr_plot_02_train_test_split_thumb.png :alt: - :ref:`sphx_glr_auto_examples_plot_05_train_test_split.py` + :ref:`sphx_glr_auto_examples_02_diagnose_plot_02_train_test_split.py` .. raw:: html @@ -110,12 +177,12 @@ They also serve as our user guide. .. toctree:: :hidden: + :includehidden: + - /auto_examples/plot_01_getting_started - /auto_examples/plot_02_overview_skore_project - /auto_examples/plot_03_cross_validate - /auto_examples/plot_04_tracking_items - /auto_examples/plot_05_train_test_split + /auto_examples/00_getting_started/index.rst + /auto_examples/01_track/index.rst + /auto_examples/02_diagnose/index.rst .. only:: html diff --git a/docs/latest/api.html b/docs/latest/api.html index 8404c5789..ac7d72143 100644 --- a/docs/latest/api.html +++ b/docs/latest/api.html @@ -57,7 +57,7 @@ - + @@ -527,7 +527,7 @@

Get assistance when developing ML/DS projects
diff --git a/docs/latest/auto_examples/00_getting_started/index.html b/docs/latest/auto_examples/00_getting_started/index.html new file mode 100644 index 000000000..37861b3e1 --- /dev/null +++ b/docs/latest/auto_examples/00_getting_started/index.html @@ -0,0 +1,580 @@ + + + + + + + + + + + Getting started — skore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ +
+ + + + + +
+
+ + + + +
+ + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+ +
+ +
+ + +
+ +
+ + +
+
+ + + + + +
+ +
+

Getting started#

+

We recommend first having a look at this example that serves as an overall and gentle +introduction to skore.

+
+

Getting started with skore

+
Getting started with skore
+
+
+
+ + +
+ + + + + + + +
+ + + + +
+ + +
+
+ +
+ +
+
+
+ + + + + +
+ + +
+ + \ No newline at end of file diff --git a/docs/latest/auto_examples/plot_01_getting_started.html b/docs/latest/auto_examples/00_getting_started/plot_01_getting_started.html similarity index 78% rename from docs/latest/auto_examples/plot_01_getting_started.html rename to docs/latest/auto_examples/00_getting_started/plot_01_getting_started.html index bd2fc7a36..b6ce26091 100644 --- a/docs/latest/auto_examples/plot_01_getting_started.html +++ b/docs/latest/auto_examples/00_getting_started/plot_01_getting_started.html @@ -2,7 +2,7 @@ - + @@ -27,37 +27,37 @@ - - - - - - - - - - - + + + + + + + + + + + - + - - - - - - - - - + + + + + + + + + - - - - - - + + + + + + @@ -79,7 +79,7 @@
@@ -429,12 +438,15 @@ @@ -455,25 +467,25 @@
-

Getting started with skore#

+

Getting started with skore#

This getting started guide illustrates how to use skore and why:

    -
  1. Track and visualize your ML/DS results using skore’s Project and UI.

  2. +
  3. Track and visualize your ML/DS results using skore’s Project and UI.

  4. Machine learning diagnostics: get assistance when developing your ML/DS projects.

Track and visualize: skore project and UI#

-

A key feature of skore is its Project that allows to store +

A key feature of skore is its Project that allows to store items of many types then visualize them in a dashboard called the skore UI.

Creating and loading a skore project, and launching the skore UI#

@@ -489,15 +501,15 @@

Creating and loading a skore project, and launching the skore UI
import skore
 
-my_project = skore.create("my_project", working_dir=temp_dir_path)
+my_project = skore.create("my_project", working_dir=temp_dir_path)
 

-
[11/29/24 16:48:41] <Logger skore.project.project (INFO)> Project  create.py:148
+
[12/02/24 07:55:31] <Logger skore.project.project (INFO)> Project  create.py:148
                                                           file
                                                           '/tmp/sk
                                                           ore_exam
-                                                          ple_lfp6
-                                                          7wcv/my_
+                                                          ple_7jdu
+                                                          46nf/my_
                                                           project.
                                                           skore'
                                                           was
@@ -514,7 +526,7 @@ 

Creating and loading a skore project, and launching the skore UI

@@ -524,8 +536,8 @@

Creating and loading a skore project, and launching the skore UIput()) some useful items in it.

-
my_project.put("my_int", 3)
+directory) to add (put()) some useful items in it.

+
my_project.put("my_int", 3)
 
@@ -1059,21 +1071,21 @@

Skore project and storage: example of hyperparameter sweepplt.show()

-Ridge regression
+Ridge regression

Finally, we store some relevant information to our skore project, so that we can visualize them later in the skore UI for example:

-
my_project.put("my_gs_cv", gs_cv)
-my_project.put("my_df", df)
-my_project.put("my_fig", fig)
+
my_project.put("my_gs_cv", gs_cv)
+my_project.put("my_df", df)
+my_project.put("my_fig", fig)
 

See also

For more information about the functionalities and the different types -of items that we can store in a skore Project, -see Overview of the skore project.

+of items that we can store in a skore Project, +see Overview of the skore project.

@@ -1100,7 +1112,7 @@

Tracking the history of items

See also

For more information about the tracking of items using their history, -see Tracking items using their history.

+see Tracking items using their history.

@@ -1111,42 +1123,42 @@

Machine learning diagnostics: enhancing scikit-learn functions

Cross-validation with skore#

In order to assist its users when programming, skore has implemented a -skore.cross_validate() function that wraps scikit-learn’s +skore.cross_validate() function that wraps scikit-learn’s sklearn.model_selection.cross_validate().

On the same previous data and a Ridge regressor (with default alpha value), let us launch skore’s cross-validation, which will automatically add -(put()) +(put()) a cross_validation item with a plotly chart in our project.

-
from skore import cross_validate
+
from skore import cross_validate
 
-cv_results = cross_validate(Ridge(), X, y, cv=5, project=my_project)
+cv_results = cross_validate(Ridge(), X, y, cv=5, project=my_project)
 
-fig_plotly = my_project.get_item("cross_validation").plot
+fig_plotly = my_project.get_item("cross_validation").plot
 fig_plotly
 
-
+


Hence, we can observe some key metrics and get insights on our cross-validation.

See also

-

For more information about the motivation and usage of skore.cross_validate(), -see Enhancing cross-validation.

+

For more information about the motivation and usage of skore.cross_validate(), +see Enhancing cross-validation.

Train-test split with skore#

-

Skore has implemented a skore.train_test_split() function that wraps +

Skore has implemented a skore.train_test_split() function that wraps scikit-learn’s sklearn.model_selection.train_test_split().

For example, it can raise warnings when there is class imbalance in the data to provide methodological advice:

X = np.arange(400).reshape((200, 2))
 y = [0] * 150 + [1] * 50
 
-X_train, X_test, y_train, y_test = skore.train_test_split(
+X_train, X_test, y_train, y_test = skore.train_test_split(
     X=X, y=y, test_size=0.2, random_state=0
 )
 
@@ -1167,7 +1179,7 @@

Train-test split with skore

See also

For more information about the motivation and usage of -skore.train_test_split(), see Enhancing train-test split.

+skore.train_test_split(), see Enhancing train-test split.

Stay tuned for some new features!

@@ -1179,16 +1191,16 @@

Cleanup the project
temp_dir.cleanup()
 

-

Total running time of the script: (0 minutes 5.282 seconds)

-
-
[11/29/24 16:48:46] <Logger skore.project.project (INFO)> Project  create.py:148
+
[12/02/24 07:55:36] <Logger skore.project.project (INFO)> Project  create.py:148
                                                           file
                                                           '/tmp/sk
                                                           ore_exam
-                                                          ple_xudu
-                                                          7p_p/my_
+                                                          ple_g4dh
+                                                          y3_2/my_
                                                           project.
                                                           skore'
                                                           was
@@ -496,14 +508,14 @@ 

Creating and loading the skore project

Storing integers#

-

Now, let us store our first object using put(), for example an +

Now, let us store our first object using put(), for example an integer:

-
my_project.put("my_int", 3)
+
my_project.put("my_int", 3)
 

Here, the name of the object is my_int and the integer value is 3.

-

We can read it from the project by using get():

-
my_project.get("my_int")
+

We can read it from the project by using get():

+
my_project.get("my_int")
 
3
@@ -511,11 +523,11 @@ 

Storing integersput method will overwrite past data if we use a key that already exists!

-
my_project.put("my_int", 30_000)
+
my_project.put("my_int", 30_000)
 

We can check the updated value:

-
my_project.get("my_int")
+
my_project.get("my_int")
 
-

By using the delete_item() method, we can also delete an object +

By using the delete_item() method, we can also delete an object so that our skore UI does not become cluttered:

-
my_project.put("my_int_2", 10)
+
my_project.put("my_int_2", 10)
 
-
my_project.delete_item("my_int_2")
+
 

We can display all the keys in our project:

-
my_project.list_item_keys()
+
 
['my_int']
@@ -546,19 +558,19 @@ 

Storing integers

Storing strings and texts#

We just stored a integer, now let us store some text using strings!

-
my_project.put("my_string", "Hello world!")
+
my_project.put("my_string", "Hello world!")
 
-
my_project.get("my_string")
+
my_project.get("my_string")
 
'Hello world!'
 
-

get() infers the type of the inserted object by default. For +

get() infers the type of the inserted object by default. For example, strings are assumed to be in Markdown format. Hence, we can customize the display of our text:

-
my_project.put(
+
my_project.put(
     "my_string_2",
     (
         """Hello world!, **bold**, *italic*, `code`
@@ -576,7 +588,7 @@ 

Storing strings and texts
from skore.item import MediaItem
 
-my_project.put_item(
+my_project.put_item(
     "my_string_3",
     MediaItem.factory(
         "<p><h1>Title</h1> <b>bold</b>, <i>italic</i>, etc.</p>", media_type="text/html"
@@ -586,10 +598,10 @@ 

Storing strings and texts

Note

-

We used put_item() instead of put().

+

We used put_item() instead of put().

Note that the media type is only used for the UI, and not in this notebook at hand:

-
my_project.get("my_string_3")
+
my_project.get("my_string_3")
 
b'<p><h1>Title</h1> <b>bold</b>, <i>italic</i>, etc.</p>'
@@ -598,7 +610,7 @@ 

Storing strings and texts
x = 2
 y = [1, 2, 3, 4]
-my_project.put("my_string_4", f"The value of `x` is {x} and the value of `y` is {y}.")
+my_project.put("my_string_4", f"The value of `x` is {x} and the value of `y` is {y}.")
 

@@ -606,7 +618,7 @@

Storing strings and texts#

Python list:

my_list = [1, 2, 3, 4]
-my_project.put("my_list", my_list)
+my_project.put("my_list", my_list)
 my_list
 
@@ -618,7 +630,7 @@

Storing many kinds of data"company": "probabl", "year": 2023, } -my_project.put("my_dict", my_dict) +my_project.put("my_dict", my_dict) my_dict

@@ -629,20 +641,20 @@

Storing many kinds of data

-
array([[ 0.99281681,  0.44219449,  0.65533057],
-       [-0.24864296,  1.10948341, -2.10146096],
-       [ 0.44376087, -1.53459009,  0.38465483]])
+
array([[ 1.8312195 , -0.35893268,  0.94549297],
+       [ 1.27768204,  0.62375238,  1.34861347],
+       [-1.01895005,  0.46187983, -0.99992579]])
 

Pandas data frame:

import pandas as pd
 
 my_df_pandas = pd.DataFrame(np.random.randn(10, 5))
-my_project.put("my_df_pandas", my_df_pandas)
+my_project.put("my_df_pandas", my_df_pandas)
 my_df_pandas.head()
 
@@ -675,43 +687,43 @@

Storing many kinds of data
import polars as pl
 
 my_df_polars = pl.DataFrame(np.random.randn(10, 5))
-my_project.put("my_df_polars", my_df_polars)
+my_project.put("my_df_polars", my_df_polars)
 my_df_polars.head()
 

@@ -734,7 +746,7 @@

Storing many kinds of datacolumn_0column_1column_2column_3column_4f64f64f64f64f640.8282421.210976-1.651619-1.5664581.141409-1.257238-0.243915-1.164194-0.177233-0.9443271.6915110.65013-1.2615720.493694-0.2293080.512165-0.0104040.1853860.1319881.89348-0.928704-0.365251-0.512659-1.9649440.827703

+shape: (5, 5)
column_0column_1column_2column_3column_4
f64f64f64f64f64
-2.016784-1.578340.486351-0.046798-0.196609
0.749376-0.0552530.5081111.474227-0.162663
0.352716-0.4316170.086720.749166-0.229909
1.3516041.2398780.5582780.6178670.436303
2.1371330.0399240.1658320.4098781.445417


@@ -757,10 +769,10 @@

Storing data visualizationsax.legend() plt.show() -my_project.put("my_figure", fig) +my_project.put("my_figure", fig) -Simple Plot
+Simple Plot

Altair chart:

@@ -781,7 +793,7 @@

Storing data visualizations.properties(title="My title") ) -my_project.put("my_altair_chart", my_altair_chart) +my_project.put("my_altair_chart", my_altair_chart)

@@ -802,14 +814,14 @@

Storing data visualizationsdf, x=df.sepal_length, y=df.sepal_width, color=df.species, size=df.petal_length ) -my_project.put("my_plotly_fig", fig) +my_project.put("my_plotly_fig", fig) fig

-
+


Animated Plotly figure:

@@ -829,17 +841,17 @@

Storing data visualizationsrange_y=[25, 90], ) -my_project.put("my_anim_plotly_fig", my_anim_plotly_fig) +my_project.put("my_anim_plotly_fig", my_anim_plotly_fig) my_anim_plotly_fig
-

@@ -852,7 +864,7 @@

Storing data visualizationswith io.BytesIO() as output: my_pil_image.save(output, format="png") -my_project.put("my_pil_image", my_pil_image) +my_project.put("my_pil_image", my_pil_image) @@ -864,7 +876,7 @@

Storing scikit-learn models and pipelines @@ -1283,7 +1295,7 @@

Storing scikit-learn models and pipelinesmy_pipeline = Pipeline( [("standard_scaler", StandardScaler()), ("lasso", Lasso(alpha=2))] ) -my_project.put("my_pipeline", my_pipeline) +my_project.put("my_pipeline", my_pipeline) my_pipeline @@ -1705,7 +1717,7 @@

Storing scikit-learn models and pipelinesy = diabetes.target[:150] my_pipeline.fit(X, y) -my_project.put("my_fitted_pipeline", my_pipeline) +my_project.put("my_fitted_pipeline", my_pipeline) my_pipeline @@ -2125,16 +2137,16 @@

Cleanup the project
temp_dir.cleanup()
 
-

Total running time of the script: (0 minutes 0.813 seconds)

-