Skip to content

Update imbalanced classsification notebook#22

Open
AnneBeyer wants to merge 18 commits into
probabl-ai:mainfrom
AnneBeyer:update_imbalanced_classsification
Open

Update imbalanced classsification notebook#22
AnneBeyer wants to merge 18 commits into
probabl-ai:mainfrom
AnneBeyer:update_imbalanced_classsification

Conversation

@AnneBeyer

Copy link
Copy Markdown
Collaborator

While working through the notebook, I updated it as follows:

  • replaced the deprecated penalty=None with C=np.inf (and added a comment for explicitness)
  • replaced the use of _CurveScorer with metric_at_thresholds
  • added an explicit xlabel and hline where I found it helpful
  • fixed typos and an n_bins inconsistency with the solutions

@AnneBeyer

Copy link
Copy Markdown
Collaborator Author

Running

pixi run jupyter lab

gave me the following warnings and errors:

 WARN Encountered 1 warning while parsing the manifest:
  ⚠ The `project` field is deprecated. Use `workspace` instead.
   ╭─[/home/anne/Projects/calibration-cost-sensitive-learning/pixi.toml:1:1]
 1 │ ╭─▶ [project]
 2 │ │   name = "calibration-cost-sensitive-learning"
 3 │ │   version = "0.1.0"
 4 │ │   description = "Probabilistic calibration of cost-sensitive learning"
 5 │ │   authors = ["Guillaume Lemaitre <guillaume@probabl.ai>", "Olivier Grisel <olivier@probabl.ai>"]
 6 │ │   channels = ["conda-forge"]
 7 │ ├─▶ platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
   · ╰──── replace this with 'workspace'
 8 │     
   ╰────

 WARN the lock file is up-to-date but uses an older format (v6), run `pixi lock` to upgrade to v7 for improved reproducibility
Error:   × failed to link skore-hub-project-0.0.7-pyhd8ed1ab_0.conda
  ├─▶ failed to read 'link.json'
  ╰─▶ entry point function must be a Python dotted identifier: "login\"" at
      line 8 column 3

Updating the format to v7 changes the whole lock file structure. I can open a separate PR for updating that.

The skrub error could be resolved by using a newer version (removing the upper bound resolved to version 0.19), but I haven't checked if this leads to any problems in the other notebooks in the repo yet.

@glemaitre

Copy link
Copy Markdown
Member

Thanks @AnneBeyer. Feel free to compact everything in the same PR if it makes it easier. As you wish.

@AnneBeyer AnneBeyer marked this pull request as draft July 3, 2026 10:50
@glemaitre

Copy link
Copy Markdown
Member

We might want to update the pyodide kernel used by jupyter-lite. If I have time, I'll check if we could use https://notebook.link to give it a try.

@AnneBeyer AnneBeyer marked this pull request as ready for review July 3, 2026 12:30
@AnneBeyer

Copy link
Copy Markdown
Collaborator Author

We might want to update the pyodide kernel used by jupyter-lite.

If I understand the pixi.toml correctly, we use the most recent kernel. But I did update jupyterlab to the newest version as well. Now everything should run.

@ogrisel

ogrisel commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

@AnneBeyer the CI fails with:

[1](https://github.com/probabl-ai/calibration-cost-sensitive-learning/actions/runs/28660629985/job/85028731562?pr=22#step:3:14)
pixi install -e default --locked
  /home/runner/.pixi/bin/pixi install -e default --locked --manifest-path pixi.toml --color always
  Error: 
    × Failed to load lock file from `/home/runner/work/calibration-cost-
    │ sensitive-learning/calibration-cost-sensitive-learning/pixi.lock`
    ╰─▶ The lock file version is 7, but only up to including version 6 is
        supported by the current version.
    help: Please update pixi to the latest version and try again.

the pixi version needs to be updated.

@ogrisel

ogrisel commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

@AnneBeyer I just sent you an invitation to join this repo and grant you more permissions so that we won't have to manually approve the workflow run each time on your PR.

@glemaitre

Copy link
Copy Markdown
Member

We are using an old kernel: https://github.com/probabl-ai/calibration-cost-sensitive-learning/blob/main/jupyterlite/jupyter-lite.json#L6

This is the new version: https://pyodide.org/en/stable/project/changelog.html

I'll try to update all this part and I'll do a PR on your PR if I make it work quickly.
But from the changelog, I'm not sure that polars is available and we might still be stuck with the old build.

@glemaitre

Copy link
Copy Markdown
Member

I just realise that we don't have any polars in those notebooks so we should be able to easily upgrade pyodide (just confused the notebook with the time-series forecasting).

- Bump jupyterlite and jupyterlite-pyodide-kernel to 0.8.x, the series that
  targets pyodide 314.x (Python 3.14).
- Point the JupyterLite pyodide kernel to pyodide v314.0.2.
- Load the credit-card parquet without forcing fastparquet: pyodide 314 no
  longer ships fastparquet, so let pandas auto-select the engine (pyarrow in
  the browser, fastparquet in the local/CI env).
glemaitre and others added 5 commits July 4, 2026 15:07
- pixi 0.41.1 could not read the version-7 lock file; bump the CI pixi to
  v0.72.0 (matches the pixi used to generate the lock).
- Update actions to their Node 24 releases to fix the Node 20 deprecation:
  actions/checkout@v5, prefix-dev/setup-pixi@v0.10.0,
  peaceiris/actions-gh-pages@v4.1.0.
Update JupyterLite to the latest pyodide (314)
@AnneBeyer AnneBeyer marked this pull request as draft July 6, 2026 09:05
@AnneBeyer AnneBeyer added this to Labs Jul 6, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Labs Jul 6, 2026
@AnneBeyer AnneBeyer moved this from Todo to In progress in Labs Jul 6, 2026
@AnneBeyer

Copy link
Copy Markdown
Collaborator Author

So the current test failure is related to computational_perfomance.py, which used joblib to dump model reports that are now outdated with the version updates. I retrained the models locally and updated the plotting to match the current version, but the report .joblib files are too large to update with GitHub. I'm not sure what to do here.

@AnneBeyer

Copy link
Copy Markdown
Collaborator Author

There are still some notebooks I haven't looked at, but I went through the two most relevant for this year, and all CI failures are fixed now.

@AnneBeyer AnneBeyer marked this pull request as ready for review July 10, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants