|
| 1 | +Benchmarks |
| 2 | +========== |
| 3 | + |
| 4 | +Objectives |
| 5 | +---------- |
| 6 | + |
| 7 | +The benchmark folder is by the skrub maintainers to: |
| 8 | + |
| 9 | +- Experiment on new algorithms |
| 10 | +- Validate decisions based on empirical evidence |
| 11 | +- Tune (hyper)parameters in the library |
| 12 | + |
| 13 | +These benchmarks do not aim at replacing the tests within skrub. |
| 14 | + |
| 15 | +Implementing a benchmark |
| 16 | +------------------------ |
| 17 | + |
| 18 | +A mini-framework consisting of a few functions is made available under `utils`. |
| 19 | + |
| 20 | +Check out other benchmarks to see how they are used. |
| 21 | + |
| 22 | +Launching a benchmark |
| 23 | +------------------------ |
| 24 | + |
| 25 | +.. note:: |
| 26 | + |
| 27 | + Launching a benchmark is usually something you don't want to do as a user. |
| 28 | + Benchmarks are long and expensive to run. Their code is provided for reproducibility. |
| 29 | + |
| 30 | +Each one implements a standard command-line interface with the at least the two |
| 31 | +commands ``--run`` and ``--plot``. |
| 32 | + |
| 33 | +Although, before launching, you should make sure the environment is properly setup. |
| 34 | +First, install the required packages -- we recommend installing the latest versions |
| 35 | +for everything (skip `--upgrade` if you don't want to): |
| 36 | + |
| 37 | +.. code:: sh |
| 38 | +
|
| 39 | + pip install -e --upgrade .[benchmarks] |
| 40 | +
|
| 41 | +
|
| 42 | +It has also been reported that Python >=3.9 is required. |
| 43 | + |
| 44 | +Then, if you're trying to reproduce the results of a benchmark, check the file's |
| 45 | +docstring to see if it requires any additional setup. |
| 46 | +Usually, you will find a date, which might be relevant, and sometimes, a commit |
| 47 | +hash. You can use it to checkout the code at the time the benchmark was run: |
| 48 | + |
| 49 | +.. code:: sh |
| 50 | +
|
| 51 | + git checkout <commit_hash> |
| 52 | +
|
| 53 | +Finally, you can launch the benchmark with the ``--run`` command: |
| 54 | + |
| 55 | +.. code:: sh |
| 56 | +
|
| 57 | + python bench_tablevectorizer_tuning.py --run |
| 58 | +
|
| 59 | +
|
| 60 | +Analyzing results |
| 61 | +~~~~~~~~~~~~~~~~~ |
| 62 | + |
| 63 | +The results of the benchmarks ran by maintainers are pushed in the `results/` |
| 64 | +folder in a `parquet` format. |
| 65 | + |
| 66 | +As mentioned earlier, benchmarks implement a ``--plot`` option used to display |
| 67 | +the results visually. Using ``--plot`` without ``--run`` allows you to plot |
| 68 | +the saved results without re-running the benchmark. |
| 69 | + |
| 70 | +Format |
| 71 | +------ |
| 72 | + |
| 73 | +Results are saved with the format ``<name>-<YYYYMMDD>.parquet`` in the subfolder |
| 74 | +`results`. |
0 commit comments