module plotting.plot_bench_results

Short summary

module pymlbenchmark.plotting.plot_bench_results

Plotting for benchmarks.

source on GitHub

Functions

function

truncated documentation

plot_bench_results

Plots benchmark results.

Documentation

Plotting for benchmarks.

source on GitHub

pymlbenchmark.plotting.plot_bench_results.plot_bench_results(df, row_cols=None, col_cols=None, hue_cols=None, cmp_col_values=('lib', 'skl'), x_value='N', y_value='mean', err_value=('lower', 'upper'), title=None, box_side=6, labelsize=8, fontsize='small', label_fct=None, color_fct=None, ax=None)

Plots benchmark results.

Parameters:
  • df – benchmark results

  • row_cols – dataframe columns for graph rows

  • col_cols – dataframe columns for graph columns

  • hue_cols – dataframe columns for other options

  • cmp_col_values – if can be one column or one tuple (column, baseline name)

  • x_value – value for x-axis

  • y_value – value to plot on y-axis (such as mean, min, …)

  • err_value – lower and upper bounds

  • title – graph title

  • box_side – graph side, the function adjusts the size of the graph

  • labelsize – size of the labels

  • fontsize – font size see Text properties

  • label_fct – if not None, it is a function which modifies the label before printing it on the graph

  • color_fct – if not None, it is a function which modifies a color based on the label and the previous color

  • ax – existing axis

Returns:

fig, ax

Plot benchmark results

from pymlbenchmark.datasets import experiment_results
from pymlbenchmark.plotting import plot_bench_results
import matplotlib.pyplot as plt

df = experiment_results('onnxruntime_LogisticRegression')

plot_bench_results(df, row_cols='N', col_cols='method',
                   x_value='dim', hue_cols='fit_intercept',
                   title="LogisticRegression\nBenchmark scikit-learn / onnxruntime")
plt.show()

(png, hires.png, pdf)

../../_images/plot_bench_results-1.png

source on GitHub