Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1"""
2@file
3@brief Artificial datasets.
4"""
5import os
6import pandas
9def experiment_results(name):
10 """
11 Returns some real results mostly used in the documentation
12 to produce graph to illustrate a function.
14 @param name name of the dataset
15 @return dataframe
17 List of available datasets:
19 .. runpython::
21 import os
22 data = os.path.join(__WD__, 'data')
23 for name in os.listdir(data):
24 print(os.path.split(name)[0])
26 Example of use:
28 .. runpython::
29 :showcode:
31 from pymlbenchmark.datasets import experiment_results
32 print(experiment_results('onnxruntime_LogisticRegression').head())
33 """
34 this = os.path.dirname(__file__)
35 data = os.path.join(this, 'data', name + '.csv')
36 if not os.path.exists(data):
37 raise FileNotFoundError( # pragma: no cover
38 "Unable to find dataset '{}'.".format(name))
39 return pandas.read_csv(data)