Skip to content

Commit 59433d8

Browse files
committed
support for local evaluations from url
1 parent baf6e93 commit 59433d8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

openml/_api_calls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def _read_url(url, data=None):
117117
warnings.warn('Received uncompressed content from OpenML for %s.' % url)
118118
return response.text
119119

120+
120121
def _parse_server_exception(response):
121122
# OpenML has a sopisticated error system
122123
# where information about failures is provided. try to parse this

openml/runs/run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def get_metric_score(self, sklearn_fn, kwargs={}):
127127
if self.data_content is not None:
128128
predictions_arff = self._generate_arff_dict()
129129
elif 'predictions' in self.output_files:
130-
raise ValueError('Not Implemented Yet: Function can currently only be used on locally executed runs (contributor needed!)')
130+
predictions_file_url = _file_id_to_url(self.output_files['predictions'], 'predictions.arff')
131+
predictions_arff = arff.loads(openml._api_calls._read_url(predictions_file_url))
132+
# TODO: make this a stream reader
131133
else:
132134
raise ValueError('Run should have been locally executed.')
133135

openml/setups/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def list_setups(flow=None, tag=None, setup=None, offset=None, size=None):
102102
api_call += "/offset/%d" % int(offset)
103103
if size is not None:
104104
api_call += "/limit/%d" % int(size)
105-
if size is not None:
105+
if setup is not None:
106106
api_call += "/setup/%s" % ','.join([str(int(i)) for i in setup])
107107
if flow is not None:
108108
api_call += "/flow/%s" % flow

0 commit comments

Comments
 (0)