Skip to content

Commit f3afc6f

Browse files
authored
Merge pull request #316 from openml/strictercheck
Stricter check
2 parents 7e84a0b + 48b40ce commit f3afc6f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

openml/runs/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,14 @@ def get_metric_fn(self, sklearn_fn, kwargs={}):
125125
scores : list
126126
a list of floats, of length num_folds * num_repeats
127127
'''
128-
if self.data_content is not None:
128+
if self.data_content is not None and self.task_id is not None:
129129
predictions_arff = self._generate_arff_dict()
130130
elif 'predictions' in self.output_files:
131131
predictions_file_url = _file_id_to_url(self.output_files['predictions'], 'predictions.arff')
132132
predictions_arff = arff.loads(openml._api_calls._read_url(predictions_file_url))
133133
# TODO: make this a stream reader
134134
else:
135-
raise ValueError('Run should have been locally executed.')
135+
raise ValueError('Run should have been locally executed or contain outputfile reference.')
136136

137137
attribute_names = [att[0] for att in predictions_arff['attributes']]
138138
if 'correct' not in attribute_names:

0 commit comments

Comments
 (0)