Skip to content

Commit

Permalink
Merge branch 'main' into fix-ci-on-fork
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/skore.yml
  • Loading branch information
thomass-dev committed Jan 9, 2025
2 parents d532328 + 24a7c1b commit 35857f3
Show file tree
Hide file tree
Showing 55 changed files with 1,243 additions and 647 deletions.
60 changes: 56 additions & 4 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,21 @@ jobs:

backend-test:
strategy:
fail-fast: true
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest"]
python: ["3.9", "3.10", "3.11", "3.12"]
scikit-learn: ["1.6"]
include:
- os: "ubuntu-latest"
python: "3.12"
scikit-learn: "1.4"
- os: "ubuntu-latest"
python: "3.12"
scikit-learn: "1.5"
- os: "ubuntu-latest"
python: "3.12"
scikit-learn: "1.6"
coverage: true
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -64,16 +72,60 @@ jobs:
python-version: ${{ matrix.python }}
cache: pip

- name: Install dependencies
run: python -m pip install --upgrade pip build
- name: Restore python-venv
uses: actions/cache/restore@v4
id: cache-python-venv
with:
path: 'skore/venv'
key: python-venv-${{ matrix.os }}-${{ matrix.python }}-${{ matrix.scikit-learn }}-${{ hashFiles('skore/pyproject.toml') }}

- name: Setup python-venv
working-directory: "skore/"
run: |
set -eu
# Ensure venv is created
python -m venv venv
# Activate venv for each step depending on the OS
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
echo "${GITHUB_WORKSPACE}/skore/venv/bin" >> ${GITHUB_PATH}
echo "VIRTUAL_ENV=${GITHUB_WORKSPACE}/skore/venv" >> ${GITHUB_ENV}
else
echo "${GITHUB_WORKSPACE}\\skore\\venv\\Scripts" >> ${GITHUB_PATH}
echo "VIRTUAL_ENV=${GITHUB_WORKSPACE}\\skore\\venv" >> ${GITHUB_ENV}
fi
- name: Install dependencies in python-venv
working-directory: "skore/"
if: steps.cache-python-venv.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade "pip"
python -m pip install --upgrade "build"
python -m pip install --upgrade "scikit-learn ==${{ matrix.scikit-learn }}"
# Install `skore` and its dependencies
python -m pip install --upgrade ".[test]"
# Uninstall the `skore` package itself
python -m pip uninstall -y "skore"
- name: Save python-venv
uses: actions/cache/save@v4
if: steps.cache-python-venv.outputs.cache-hit != 'true'
with:
path: 'skore/venv'
key: ${{ steps.cache-python-venv.outputs.cache-primary-key }}

- name: Build
working-directory: skore/
run: python -m build

- name: Install
working-directory: skore/
run: wheel=(dist/*.whl); python -m pip install "${wheel}[test]"
run: |
# Install `skore` without its dependencies, which are present in the venv
wheel=(dist/*.whl); python -m pip install --force-reinstall --no-deps "${wheel}"
- name: Test without coverage
if: ${{ ! matrix.coverage }}
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ ENV/
env.bak/
venv.bak/

# direnv
.direnv
.envrc

# Spyder project settings
.spyderproject
.spyproject
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ You'll need ``python >=3.9, <3.13`` to build the backend and ``Node>=20`` to bui
.. code-block:: bash
make install-skore
skore create
make build-skore-ui
make serve-skore-ui
Expand Down
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,14 @@
<source srcset="https://media.githubusercontent.com/media/probabl-ai/skore/main/sphinx/_static/images/[email protected]" media="(prefers-color-scheme: dark)">
<img width="200" src="https://media.githubusercontent.com/media/probabl-ai/skore/main/sphinx/_static/images/[email protected]" alt="skore logo">
</picture>
<h3>the scikit-learn sidekick</h3>

<h2>The scikit-learn Modeling Companion</h2>

__Elevate ML Development with Tracking and Built-in Recommended Practices__ \
Elevate ML Development with Tracking and Built-in Recommended Practices \
[Documentation](https://skore.probabl.ai)[Community](https://discord.probabl.ai)

<br />

![license](https://img.shields.io/pypi/l/skore)
![python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue?style=flat&logo=python)
[![downloads](https://static.pepy.tech/badge/skore/month)](https://pepy.tech/projects/skore)
[![pypi](https://img.shields.io/pypi/v/skore)](https://pypi.org/project/skore/)
![ci](https://github.com/probabl-ai/skore/actions/workflows/ci.yml/badge.svg?event=push)
[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.probabl.ai/)

</div>

<br />

## Why skore?

Expand Down Expand Up @@ -107,9 +98,17 @@ Thank you for considering contributing to skore! Join our mission to promote ope

## Feedback & Community

- Join our [Discord](https://discord.probabl.ai/) to share ideas or get support.
- Request a feature or report a bug via [GitHub Issues](https://github.com/probabl-ai/skore/issues).
- Join our [Discord](https://discord.probabl.ai/) to share ideas or get support.
- Request a feature or report a bug via [GitHub Issues](https://github.com/probabl-ai/skore/issues).

<br />

![license](https://img.shields.io/pypi/l/skore)
![python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue?style=flat&logo=python)
[![downloads](https://static.pepy.tech/badge/skore/month)](https://pepy.tech/projects/skore)
[![pypi](https://img.shields.io/pypi/v/skore)](https://pypi.org/project/skore/)
![ci](https://github.com/probabl-ai/skore/actions/workflows/ci.yml/badge.svg?event=push)
[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://discord.probabl.ai/)

---

Expand Down
27 changes: 27 additions & 0 deletions docs/design/0002-never-present-neg-metrics-from-sklearn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
status: accepted
date: 2025-01-06
decision-makers: ["@augustebaum", "@sylvaincom", "@glemaitre"]
consulted: ["@ogrisel"]
---

# Never show `neg_*` metrics from sklearn

## Context and Problem Statement

We show various metrics to users, many directly using sklearn.
In sklearn, many metrics are multiplied by -1 and prefixed with `neg_`, with the purpose of making all metrics "higher-is-better". This way, optimization tools in sklearn such as `GridSearchCV` do not need to figure out which way the metric should be optimized.
This is specific to sklearn, and there is no reason to port this design over to skore.

## Decision Drivers

* Our data-science-literate collaborators (@ogrisel, @glemaitre, @sylvaincom) consider the `neg_` trick should remain a solution to a sklearn-specific problem, and not be displayed in plots for the skore user.

## Decision Outcome

Chosen option: Never show `neg_*` metrics from sklearn in skore, only use the positive counterparts. This makes reports clearer.

### Consequences

* We show the most relevant information to the user.
* We might have to take on the responsibility of maintaining the "metric is higher-is-better" pre-condition ourselves.
5 changes: 1 addition & 4 deletions examples/getting_started/plot_quick_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# %%
import skore

my_project = skore.create("quick_start", overwrite=True)
my_project = skore.open("quick_start", overwrite=True)

# %%
# This will create a skore project directory named ``quick_start.skore`` in your
Expand Down Expand Up @@ -42,9 +42,6 @@
# %%
reporter.plots.scores

# %%
reporter.plots.timing_normalized

# %%
# Finally, from your shell (in the same directory), start the UI:
#
Expand Down
4 changes: 2 additions & 2 deletions examples/getting_started/plot_skore_product_tour.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#
# import skore
#
# my_project = skore.create("my_project")
# my_project = skore.open("my_project")
#
# This would create a skore project directory named ``my_project.skore`` in our
# current directory.
Expand All @@ -66,7 +66,7 @@
# %%
import skore

my_project = skore.create("my_project", working_dir=temp_dir_path)
my_project = skore.open(temp_dir_path / "my_project")

# %%
# Then, *from our shell* (in the same directory), we can start the UI locally:
Expand Down
2 changes: 1 addition & 1 deletion examples/getting_started/plot_tracking_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# %%
import skore

my_project = skore.create("my_project", working_dir=temp_dir_path)
my_project = skore.open(temp_dir_path / "my_project")

# %%
# Tracking an integer
Expand Down
2 changes: 1 addition & 1 deletion examples/getting_started/plot_working_with_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# %%
import skore

my_project = skore.create("my_project", working_dir=temp_dir_path)
my_project = skore.open(temp_dir_path / "my_project")

# %%
# Storing integers
Expand Down
2 changes: 1 addition & 1 deletion examples/model_evaluation/plot_cross_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# %%
import skore

my_project = skore.create("my_project", working_dir=temp_dir_path)
my_project = skore.open(temp_dir_path / "my_project")

# %%
# Cross-validation in scikit-learn
Expand Down
2 changes: 1 addition & 1 deletion examples/model_evaluation/plot_train_test_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# %%
import skore

my_project = skore.create("my_project", working_dir=temp_dir_path)
my_project = skore.open(temp_dir_path / "my_project")

# %%
# Train-test split in scikit-learn
Expand Down
Binary file modified skore-ui/src/assets/fonts/icomoon.eot
Binary file not shown.
Loading

0 comments on commit 35857f3

Please sign in to comment.