Skip to content

Commit fe93b58

Browse files
committed
typos, minor refactoring
1 parent 31ef4ff commit fe93b58

4 files changed

Lines changed: 32 additions & 7 deletions

File tree

openml/_api_calls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _read_url(self, url, add_authentication=False, data=None, filePath=None):
5151
return _read_url(url, data)
5252

5353

54-
def fileid_to_url(file_id, filename=None):
54+
def _file_id_to_url(file_id, filename=None):
5555
'''
5656
Presents the URL how to download a given file id
5757
filename is optional

openml/runs/functions.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from ..exceptions import OpenMLCacheException, OpenMLServerException
1919
from ..util import URLError, version_complies
20-
from .._api_calls import _perform_api_call, fileid_to_url
20+
from .._api_calls import _perform_api_call, _file_id_to_url
2121
from .run import OpenMLRun, _get_version_information
2222
from .trace import OpenMLRunTrace, OpenMLTraceIteration
2323

@@ -99,6 +99,17 @@ def run_task(task, model, avoid_duplicate_runs=True, flow_tags=None, seed=None):
9999

100100

101101
def get_run_trace(run_id):
102+
"""Get the optimization trace object for a given run id.
103+
104+
Parameters
105+
----------
106+
run_id : int
107+
108+
Returns
109+
-------
110+
openml.runs.OpenMLTrace
111+
"""
112+
102113
trace_xml = _perform_api_call('run/trace/%d' % run_id)
103114
run_trace = _create_trace_from_description(trace_xml)
104115
return run_trace
@@ -124,7 +135,7 @@ def initialize_model_from_run(run_id):
124135

125136
def initialize_model_from_trace(run_id, repeat, fold, iteration=None):
126137
'''
127-
Initialized a model based on the parameters that were set
138+
Initialize a model based on the parameters that were set
128139
by an optimization procedure (i.e., using the exact same
129140
parameter settings)
130141
@@ -146,7 +157,7 @@ def initialize_model_from_trace(run_id, repeat, fold, iteration=None):
146157
Returns
147158
-------
148159
model : sklearn model
149-
the scikitlearn model with all parameters initailized
160+
the scikit-learn model with all parameters initailized
150161
'''
151162
run_trace = get_run_trace(run_id)
152163

openml/runs/trace.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ class OpenMLRunTrace(object):
55
66
Parameters
77
----------
8-
FIXME
8+
run_id : int
9+
10+
trace_iterations : dict
11+
Mapping from key ``(repeat, fold, iteration)`` to an object of
12+
OpenMLTraceIteration.
913
1014
"""
1115

@@ -28,7 +32,17 @@ class OpenMLTraceIteration(object):
2832
2933
Parameters
3034
----------
31-
FIXME
35+
repeat : int
36+
37+
fold : int
38+
39+
iteration : int
40+
41+
setup_string : FIXME
42+
43+
evaluation : FIXME
44+
45+
selected : FIXME
3246
"""
3347

3448
def __init__(self, repeat, fold, iteration, setup_string, evaluation, selected):

tests/test_runs/test_run_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _check_serialized_optimized_run(self, run_id):
3636
# TODO: assert holdout task
3737

3838
# downloads the predictions of the old task
39-
predictions_url = openml._api_calls.fileid_to_url(run.output_files['predictions'])
39+
predictions_url = openml._api_calls._file_id_to_url(run.output_files['predictions'])
4040
predictions = arff.loads(openml._api_calls._read_url(predictions_url))
4141

4242
# downloads the best model based on the optimization trace

0 commit comments

Comments
 (0)