Skip to content

Commit e46006a

Browse files
committed
♻️ improve benchmark reproducibility
1 parent b21e669 commit e46006a

4 files changed

Lines changed: 8658 additions & 357 deletions

File tree

paper/scripts/README.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,42 @@
22

33
The scripts in this directory reproduce benchmark results used in the paper.
44

5-
## Additional dependencies
5+
## Benchmark environment
66

77
The benchmark script (`benchmark.py`) additionally imports:
88

99
- `xgboost`
1010
- `catboost`
1111
- `tabpfn`
1212

13-
These are **benchmark-only** dependencies. They are intentionally not required by
14-
the core `sklearn-contrib-bde` package and are therefore not listed under the
15-
main project dependencies.
13+
These are **benchmark-only** dependencies. They are intentionally kept out of
14+
the core `sklearn-contrib-bde` package and provided through the optional pixi
15+
`benchmark` environment instead.
1616

1717
## Setup
1818

1919
Run from the repository root unless noted otherwise.
2020

21-
1. Create/install the base project environment as specified in the main project
22-
documentation.
21+
1. Install the benchmark environment:
2322

24-
2. Install benchmark-only Python packages into the pixi environment:
23+
```bash
24+
pixi install -e benchmark
25+
```
26+
27+
This installs the locked benchmark dependencies, including `pip`, `xgboost`,
28+
`catboost`, and `tabpfn`; no manual `pip install` or `ensurepip` step is needed.
29+
30+
2. Run a benchmark through the pixi task. For example:
2531

2632
```bash
27-
pixi run python -m pip install xgboost catboost tabpfn
33+
pixi run -e benchmark benchmark --dataset airfoil --models linear rf --n-runs 5
2834
```
2935

30-
3. Run the benchmark script `paper/scripts/run_bench.sh` to reproduce the benchmark.
36+
The task invokes `paper/scripts/run_bench.sh`. The wrapper resolves its paths
37+
relative to its own location, so this equivalent command also works from the
38+
repository root:
39+
40+
```bash
41+
pixi run -e benchmark bash paper/scripts/run_bench.sh \
42+
--dataset airfoil --models linear rf --n-runs 5
43+
```

paper/scripts/run_bench.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
3+
4+
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
5+
36
set -a
4-
source scripts/bench.env
7+
source "${script_dir}/bench.env"
58
set +a
6-
python scripts/benchmark.py "$@"
9+
10+
python "${script_dir}/benchmark.py" "$@"

0 commit comments

Comments
 (0)