from sklearn_benchmarks.reporting.hp_match import HpMatchReporting
from sklearn_benchmarks.utils import default_results_directory
from pathlib import Path
import pandas as pd
pd.set_option('display.max_colwidth', None)
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
results_dir = default_results_directory()
# Parameters
results_dir = "./results/local/20220316T120802/"
results_dir = Path(results_dir)
reporting = HpMatchReporting(other_library="onnx", config="config.yml", log_scale=True, results_dir=results_dir)
reporting.make_report()
We assume here there is a perfect match between the hyperparameters of both librairies. For a given set of parameters and a given dataset, we compute the speed-up
time scikit-learn / time onnx
. For instance, a speed-up of 2 means that onnx is twice as fast as scikit-learn for a given set of parameters and a given dataset.
onnx (1.11.0) vs. scikit-learn (1.0.2)
All estimators share the following parameters: algorithm=brute
.
predict
function | n_samples_train | n_samples | n_features | mean_duration_sklearn | std_duration_sklearn | iteration_throughput | latency | n_jobs | n_neighbors | accuracy_score_sklearn | mean_duration_onnx | std_duration_onnx | accuracy_score_onnx | speedup | std_speedup | sklearn_profiling | onnx_profiling | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | predict | 100000 | 1000 | 100 | 2.773 | 0.379 | 0.000 | 0.003 | -1 | 1 | 0.676 | 13.631 | 0.005 | 0.676 | 0.203 | 0.203 | Download | Download |
1 | predict | 100000 | 1 | 100 | 0.022 | 0.002 | 0.000 | 0.022 | -1 | 1 | 0.000 | 0.265 | 0.002 | 0.000 | 0.083 | 0.083 | Download | Download |
2 | predict | 100000 | 1000 | 100 | 3.143 | 0.073 | 0.000 | 0.003 | -1 | 5 | 0.743 | 13.560 | 0.025 | 0.743 | 0.232 | 0.232 | Download | Download |
3 | predict | 100000 | 1 | 100 | 0.024 | 0.002 | 0.000 | 0.024 | -1 | 5 | 1.000 | 0.266 | 0.002 | 1.000 | 0.088 | 0.088 | Download | Download |
4 | predict | 100000 | 1000 | 100 | 1.792 | 0.002 | 0.000 | 0.002 | 1 | 100 | 0.846 | 13.636 | 0.100 | 0.846 | 0.131 | 0.131 | Download | Download |
5 | predict | 100000 | 1 | 100 | 0.020 | 0.000 | 0.000 | 0.020 | 1 | 100 | 1.000 | 0.265 | 0.003 | 1.000 | 0.076 | 0.076 | Download | Download |
6 | predict | 100000 | 1000 | 100 | 2.868 | 0.060 | 0.000 | 0.003 | -1 | 100 | 0.846 | 13.712 | 0.041 | 0.846 | 0.209 | 0.209 | Download | Download |
7 | predict | 100000 | 1 | 100 | 0.022 | 0.003 | 0.000 | 0.022 | -1 | 100 | 1.000 | 0.263 | 0.003 | 1.000 | 0.085 | 0.085 | Download | Download |
8 | predict | 100000 | 1000 | 100 | 1.779 | 0.005 | 0.000 | 0.002 | 1 | 5 | 0.743 | 13.583 | 0.041 | 0.743 | 0.131 | 0.131 | Download | Download |
9 | predict | 100000 | 1 | 100 | 0.020 | 0.000 | 0.000 | 0.020 | 1 | 5 | 1.000 | 0.266 | 0.002 | 1.000 | 0.076 | 0.076 | Download | Download |
10 | predict | 100000 | 1000 | 100 | 1.159 | 0.007 | 0.001 | 0.001 | 1 | 1 | 0.676 | 13.699 | 0.044 | 0.676 | 0.085 | 0.085 | Download | Download |
11 | predict | 100000 | 1 | 100 | 0.020 | 0.001 | 0.000 | 0.020 | 1 | 1 | 0.000 | 0.266 | 0.002 | 0.000 | 0.075 | 0.075 | Download | Download |
12 | predict | 100000 | 1000 | 2 | 1.880 | 0.049 | 0.000 | 0.002 | -1 | 1 | 0.845 | 3.322 | 0.019 | 0.845 | 0.566 | 0.566 | Download | Download |
13 | predict | 100000 | 1 | 2 | 0.004 | 0.000 | 0.000 | 0.004 | -1 | 1 | 1.000 | 0.192 | 0.001 | 1.000 | 0.022 | 0.022 | Download | Download |
14 | predict | 100000 | 1000 | 2 | 2.701 | 0.050 | 0.000 | 0.003 | -1 | 5 | 0.883 | 3.289 | 0.006 | 0.883 | 0.821 | 0.821 | Download | Download |
15 | predict | 100000 | 1 | 2 | 0.005 | 0.000 | 0.000 | 0.005 | -1 | 5 | 1.000 | 0.193 | 0.002 | 1.000 | 0.028 | 0.028 | Download | Download |
16 | predict | 100000 | 1000 | 2 | 1.732 | 0.007 | 0.000 | 0.002 | 1 | 100 | 0.887 | 3.329 | 0.014 | 0.887 | 0.520 | 0.520 | Download | Download |
17 | predict | 100000 | 1 | 2 | 0.003 | 0.000 | 0.000 | 0.003 | 1 | 100 | 1.000 | 0.192 | 0.001 | 1.000 | 0.015 | 0.015 | Download | Download |
18 | predict | 100000 | 1000 | 2 | 2.726 | 0.094 | 0.000 | 0.003 | -1 | 100 | 0.887 | 3.708 | 0.012 | 0.887 | 0.735 | 0.735 | Download | Download |
19 | predict | 100000 | 1 | 2 | 0.008 | 0.006 | 0.000 | 0.008 | -1 | 100 | 1.000 | 0.217 | 0.003 | 1.000 | 0.039 | 0.039 | Download | Download |
20 | predict | 100000 | 1000 | 2 | 1.842 | 0.004 | 0.000 | 0.002 | 1 | 5 | 0.883 | 3.662 | 0.004 | 0.883 | 0.503 | 0.503 | Download | Download |
21 | predict | 100000 | 1 | 2 | 0.003 | 0.000 | 0.000 | 0.003 | 1 | 5 | 1.000 | 0.217 | 0.002 | 1.000 | 0.013 | 0.013 | Download | Download |
22 | predict | 100000 | 1000 | 2 | 1.081 | 0.002 | 0.000 | 0.001 | 1 | 1 | 0.845 | 3.679 | 0.016 | 0.845 | 0.294 | 0.294 | Download | Download |
23 | predict | 100000 | 1 | 2 | 0.002 | 0.000 | 0.000 | 0.002 | 1 | 1 | 1.000 | 0.217 | 0.002 | 1.000 | 0.009 | 0.009 | Download | Download |
Profiling traces can be visualized using Perfetto UI.
onnx (1.11.0) vs. scikit-learn (1.0.2)
All estimators share the following parameters: learning_rate=0.01
, n_iter_no_change=10.0
, max_leaf_nodes=100.0
, max_bins=255.0
, min_samples_leaf=100.0
, max_iter=300.0
.
predict
function | n_samples_train | n_samples | n_features | mean_duration_sklearn | std_duration_sklearn | iteration_throughput | latency | accuracy_score_sklearn | mean_duration_onnx | std_duration_onnx | accuracy_score_onnx | speedup | std_speedup | sklearn_profiling | onnx_profiling | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | predict | 100000 | 1000 | 100 | 0.131 | 0.002 | 0.006 | 0.0 | 0.795 | 0.509 | 0.005 | 0.795 | 0.257 | 0.257 | Download | Download |
Profiling traces can be visualized using Perfetto UI.
python | 3.8.12 | packaged by conda-forge | (default, Jan 30 2022, 23:42:07) [GCC 9.4.0] |
---|---|
executable | /usr/share/miniconda/envs/sklbench/bin/python |
machine | Linux-5.11.0-1028-azure-x86_64-with-glibc2.10 |
version | |
---|---|
pip | 22.0.4 |
setuptools | 60.9.3 |
sklearn | 1.0.2 |
numpy | 1.22.3 |
scipy | 1.8.0 |
Cython | None |
pandas | 1.4.1 |
matplotlib | 3.5.1 |
joblib | 1.1.0 |
threadpoolctl | 3.1.0 |
user_api | internal_api | prefix | filepath | version | threading_layer | architecture | num_threads | |
---|---|---|---|---|---|---|---|---|
0 | blas | openblas | libopenblas | /usr/share/miniconda/envs/sklbench/lib/libopenblasp-r0.3.18.so | 0.3.18 | pthreads | SkylakeX | 2 |
1 | openmp | openmp | libgomp | /usr/share/miniconda/envs/sklbench/lib/libgomp.so.1.0.0 | None | NaN | NaN | 2 |
cpu_count | 2 |
---|---|
physical_cpu_count | 2 |