Skip to content

Commit 53ff7ee

Browse files
committed
update api documentation
1 parent 08c9cf6 commit 53ff7ee

6 files changed

Lines changed: 92 additions & 71 deletions

File tree

doc/api.rst

Lines changed: 52 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,30 @@ Top-level Classes
3434
get_datasets
3535
list_datasets
3636

37+
:mod:`openml.evaluations`: Evaluation Functions
38+
-----------------------------------------------
39+
.. currentmodule:: openml.evaluations
40+
41+
.. autosummary::
42+
:toctree: generated/
43+
:template: function.rst
44+
45+
list_evaluations
46+
47+
:mod:`openml.flows`: Flow Functions
48+
-----------------------------------
49+
.. currentmodule:: openml.flows
50+
51+
.. autosummary::
52+
:toctree: generated/
53+
:template: function.rst
54+
55+
flow_exists
56+
flow_to_sklearn
57+
get_flow
58+
list_flows
59+
sklearn_to_flow
60+
3761
:mod:`openml.runs`: Run Functions
3862
----------------------------------
3963
.. currentmodule:: openml.runs
@@ -42,52 +66,49 @@ Top-level Classes
4266
:toctree: generated/
4367
:template: function.rst
4468

45-
run_task
46-
get_run
47-
get_runs
48-
list_runs
49-
list_runs_by_flow
50-
list_runs_by_tag
51-
list_runs_by_task
52-
list_runs_by_uploader
53-
list_runs_by_filters
54-
run_model_on_task
55-
run_flow_on_task
56-
get_run_trace
57-
initialize_model_from_run
58-
initialize_model_from_trace
69+
get_run
70+
get_runs
71+
get_run_trace
72+
initialize_model_from_run
73+
initialize_model_from_trace
74+
list_runs
75+
run_model_on_task
76+
run_flow_on_task
5977

60-
:mod:`openml.tasks`: Task Functions
61-
-----------------------------------
62-
.. currentmodule:: openml.tasks
78+
:mod:`openml.setups`: Setup Functions
79+
-------------------------------------
80+
.. currentmodule:: openml.setups
6381

6482
.. autosummary::
6583
:toctree: generated/
6684
:template: function.rst
6785

68-
get_task
69-
get_tasks
70-
list_tasks
86+
get_setup
87+
initialize_model
88+
list_setups
89+
setup_exists
7190

72-
:mod:`openml.flows`: Flow Functions
73-
-----------------------------------
74-
.. currentmodule:: openml.flow
91+
:mod:`openml.study`: Study Functions
92+
------------------------------------
93+
.. currentmodule:: openml.study
7594

7695
.. autosummary::
7796
:toctree: generated/
7897
:template: function.rst
7998

80-
get_flow
81-
list_flows
82-
flow_exists
83-
84-
:mod:`openml.flows`: Evaluation Functions
85-
-----------------------------------------
86-
.. currentmodule:: openml.evaluation
99+
get_study
100+
101+
:mod:`openml.tasks`: Task Functions
102+
-----------------------------------
103+
.. currentmodule:: openml.tasks
87104

88105
.. autosummary::
89106
:toctree: generated/
90107
:template: function.rst
91108

92-
list_evaluations
109+
get_task
110+
get_tasks
111+
list_tasks
112+
113+
93114

openml/evaluations/functions.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,33 @@ def list_evaluations(function, offset=None, size=None, id=None, task=None,
88
setup=None, flow=None, uploader=None, tag=None):
99
"""List all run-evaluation pairs matching all of the given filters.
1010
11-
Perform API call `/evaluation/function{function}/{filters}
12-
13-
Parameters
14-
----------
15-
function : str
16-
the evaluation function. e.g., predictive_accuracy
17-
offset : int, optional
18-
the number of runs to skip, starting from the first
19-
size : int, optional
20-
the maximum number of runs to show
11+
Perform API call ``/evaluation/function{function}/{filters}``
12+
13+
Parameters
14+
----------
15+
function : str
16+
the evaluation function. e.g., predictive_accuracy
17+
offset : int, optional
18+
the number of runs to skip, starting from the first
19+
size : int, optional
20+
the maximum number of runs to show
2121
22-
id : list, optional
22+
id : list, optional
2323
24-
task : list, optional
24+
task : list, optional
2525
26-
setup: list, optional
26+
setup: list, optional
2727
28-
flow : list, optional
28+
flow : list, optional
2929
30-
uploader : list, optional
30+
uploader : list, optional
3131
32-
tag : str, optional
32+
tag : str, optional
3333
34-
Returns
35-
-------
36-
dict
37-
"""
34+
Returns
35+
-------
36+
dict
37+
"""
3838

3939
api_call = "evaluation/list/function/%s" %function
4040
if offset is not None:

openml/flows/functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def flow_exists(name, external_version):
7575
7676
A flow is uniquely identified by name + external_version.
7777
78-
Parameter
79-
---------
78+
Parameters
79+
----------
8080
name : string
8181
Name of the flow
8282
version : string

openml/runs/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
def run_model_on_task(task, model, avoid_duplicate_runs=True, flow_tags=None,
3333
seed=None):
34-
"""See ``run_flow_on_task for a documentation."""
34+
"""See ``run_flow_on_task for a documentation``."""
3535

3636
flow = sklearn_to_flow(model)
3737

openml/runs/run.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,23 +110,23 @@ def _generate_trace_arff_dict(self):
110110
return arff_dict
111111

112112
def get_metric_fn(self, sklearn_fn, kwargs={}):
113-
'''Calculates metric scores based on predicted values. Assumes the
113+
"""Calculates metric scores based on predicted values. Assumes the
114114
run has been executed locally (and contains run_data). Furthermore,
115115
it assumes that the 'correct' attribute is specified in the arff
116116
(which is an optional field, but always the case for openml-python
117117
runs)
118118
119119
Parameters
120-
-------
120+
----------
121121
sklearn_fn : function
122122
a function pointer to a sklearn function that
123-
accepts y_true, y_pred and *kwargs
123+
accepts ``y_true``, ``y_pred`` and ``**kwargs``
124124
125125
Returns
126126
-------
127127
scores : list
128128
a list of floats, of length num_folds * num_repeats
129-
'''
129+
"""
130130
if self.data_content is not None and self.task_id is not None:
131131
predictions_arff = self._generate_arff_dict()
132132
elif 'predictions' in self.output_files:

openml/setups/functions.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def setup_exists(flow, model=None):
1111
'''
1212
Checks whether a hyperparameter configuration already exists on the server.
1313
14-
Parameter
15-
---------
14+
Parameters
15+
----------
1616
1717
flow : flow
1818
The openml flow object.
@@ -77,23 +77,23 @@ def get_setup(setup_id):
7777
def list_setups(flow=None, tag=None, setup=None, offset=None, size=None):
7878
"""List all setups matching all of the given filters.
7979
80-
Perform API call `/setup/list/{filters}
80+
Perform API call `/setup/list/{filters}`
8181
82-
Parameters
83-
----------
84-
flow : int, optional
82+
Parameters
83+
----------
84+
flow : int, optional
8585
86-
tag : str, optional
86+
tag : str, optional
8787
88-
setup : list(int), optional
88+
setup : list(int), optional
8989
90-
offset : int, optional
90+
offset : int, optional
9191
92-
size : int, optional
92+
size : int, optional
9393
94-
Returns
95-
-------
96-
dict
94+
Returns
95+
-------
96+
dict
9797
"""
9898

9999
api_call = "setup/list"

0 commit comments

Comments
 (0)