Example #1
0
 def test_plot_logreg_xtime_none(self):
     from matplotlib import pyplot as plt
     temp = get_temp_folder(__file__, "temp_plot_logreg_xtime")
     img = os.path.join(temp, "plot_logreg.png")
     data = os.path.join(temp, "..", "data",
                         "onnxruntime_LogisticRegression.perf.csv")
     df = pandas.read_csv(data)
     ax = plot_bench_xtime(df, row_cols='N', col_cols='method',
                           hue_cols=None,
                           title="unittest")
     fig = ax[0, 0].get_figure()
     fig.savefig(img)
     if __name__ == "__main__":
         plt.show()
     plt.close('all')
     self.assertExists(img)
Example #2
0
 def test_plot_logreg_xtime_bug(self):
     from matplotlib import pyplot as plt
     temp = get_temp_folder(__file__, "temp_plot_logreg_xtime_bug")
     img = os.path.join(temp, "plot_cache.png")
     data = os.path.join(temp, "..", "data",
                         "bench_plot_gridsearch_cache.csv")
     df = pandas.read_csv(data)
     ax = plot_bench_xtime(df, row_cols=['n_jobs'],
                           x_value='mean',
                           hue_cols=['N'],
                           cmp_col_values='test',
                           title="unittest")
     fig = ax[0].get_figure()
     fig.savefig(img)
     if __name__ == "__main__":
         plt.show()
     plt.close('all')
     self.assertExists(img)

def label_fct(la):
    la = la.replace("onxpython_compiled", "opyc")
    la = la.replace("onxpython", "opy")
    la = la.replace("onxonnxruntime1", "ort")
    la = la.replace("fit_intercept", "fi")
    la = la.replace("True", "1")
    la = la.replace("False", "0")
    la = la.replace("max_depth", "mxd")
    return la


plot_bench_xtime(
    df[df.norm],
    col_cols='dataset',
    hue_cols='model',
    title=
    "Numerical datasets - norm=False\nBenchmark scikit-learn / onnxruntime")
plt.savefig("%s.normT.time.png" % filename)
# plt.show()

plot_bench_xtime(
    df[~df.norm],
    col_cols='dataset',
    hue_cols='model',
    title=
    "Numerical datasets - norm=False\nBenchmark scikit-learn / onnxruntime")
plt.savefig("%s.normF.time.png" % filename)
# plt.show()

plot_bench_results(