Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/deploy_book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
permissions:
contents: write
runs-on: ubuntu-latest
env:
TABICL_TRAIN_SIZE: "1500"
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
env:
TABICL_TRAIN_SIZE: "1500"
steps:
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.10.0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ content/results
book/_build
content/notebooks
content/python_files/*_lib.py
content/python_files/*.ipynb

# jupyterlite build
jupyterlite/.jupyterlite.doit.db
Expand Down
6 changes: 5 additions & 1 deletion content/python_files/prediction_intervals_tabicl.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def tabicl_quantiles_to_df(prediction, quantiles, mode=skrub.eval_mode()):
return pl.DataFrame(prediction, schema=[f"q_{q}" for q in quantiles])


def limit_train_size(df, size=9000, mode=skrub.eval_mode()):
def limit_train_size(
df,
size=tutorial_helpers.TABICL_TRAIN_SIZE, # 9000 by default, 1500 in CI
mode=skrub.eval_mode(),
):
if mode in ("fit", "fit_transform", "preview"):
return df.tail(size)
return df
Expand Down
3 changes: 3 additions & 0 deletions content/python_files/tutorial_helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import os

import altair
import numpy as np
Expand All @@ -7,6 +8,8 @@
import polars.selectors as cs
import skrub

TABICL_TRAIN_SIZE = int(os.environ.get("TABICL_TRAIN_SIZE", "9000"))


def lorenz_curve(observed_value, predicted_value, n_samples=1_000):
"""Compute the Lorenz curve for a given true and predicted values.
Expand Down
2,126 changes: 2,042 additions & 84 deletions pixi.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ create-notebooks-dir = { cmd = "mkdir -p ./content/notebooks" }
scrape-function-definitions = { cmd = "python utils/extract_defs.py" }
copy-tutorial-helpers = { cmd = "cp ./content/python_files/tutorial_helpers.py ./content/notebooks/tutorial_helpers.py && cp ./content/python_files/*_lib.py ./content/notebooks/", depends-on = ["create-notebooks-dir", "scrape-function-definitions"] }
convert-to-notebooks = { cmd = "python utils/convert_to_notebooks.py", depends-on = ["create-notebooks-dir", "copy-tutorial-helpers", "scrape-function-definitions"] }
convert-to-executed-notebooks = { cmd = "python utils/convert_to_notebooks.py --execute --exclude single_horizon_prediction.py --exclude tabicl_time_series_forecasting.py", depends-on = ["create-notebooks-dir", "copy-tutorial-helpers", "scrape-function-definitions"] }
convert-to-executed-notebooks = { cmd = "python utils/convert_to_notebooks.py --execute", depends-on = ["create-notebooks-dir", "copy-tutorial-helpers", "scrape-function-definitions"] }
build-book = { cmd = "jupyter-book build book", depends-on = ["convert-to-notebooks", "copy-tutorial-helpers", "scrape-function-definitions"] }
build-jupyterlite = { cmd = "jupyter lite build --contents content --output-dir dist", cwd = "jupyterlite", depends-on = ["convert-to-notebooks"] }
serve-jupyterlite = { cmd = "python -m http.server", cwd = "jupyterlite/dist", depends-on = ["build-jupyterlite"] }
Expand Down Expand Up @@ -49,6 +49,7 @@ jupyter-book = ">=1.0.4,<2"
jupyterlite = "*"
jupyterlite-pyodide-kernel = "*"
python-libarchive-c = "*"
tabicl = ">=2.2.0"

[pypi-dependencies]
openmeteo-requests = ">=1.5.0, <2"
Expand Down
Loading