@@ -43,6 +43,7 @@ def __init__(self, task_id, flow_id, dataset_id, setup_string=None,
4343 self .detailed_evaluations = detailed_evaluations
4444 self .data_content = data_content
4545 self .trace_content = trace_content
46+ self .error_message = None
4647 self .task = task
4748 self .flow = flow
4849 self .run_id = run_id
@@ -136,12 +137,13 @@ def publish(self):
136137 if self .flow_id is None :
137138 raise PyOpenMLError ("OpenMLRun obj does not contain a flow id. (Should have been added while executing the task.) " );
138139
139-
140- predictions = arff .dumps (self ._generate_arff_dict ())
141140 description_xml = self ._create_description_xml ()
141+ file_elements = {'description' : ("description.xml" , description_xml )}
142+
143+ if self .error_message is None :
144+ predictions = arff .dumps (self ._generate_arff_dict ())
145+ file_elements ['predictions' ] = ("predictions.arff" , predictions )
142146
143- file_elements = {'predictions' : ("predictions.arff" , predictions ),
144- 'description' : ("description.xml" , description_xml )}
145147 if self .trace_content is not None :
146148 trace_arff = arff .dumps (self ._generate_trace_arff_dict (self .model ))
147149 file_elements ['trace' ] = ("trace.arff" , trace_arff )
@@ -175,6 +177,7 @@ def _create_description_xml(self):
175177 description = _to_dict (taskid = self .task_id , flow_id = self .flow_id ,
176178 setup_string = _create_setup_string (self .model ),
177179 parameter_settings = openml_param_settings ,
180+ error_message = self .error_message ,
178181 tags = tags )
179182 description_xml = xmltodict .unparse (description , pretty = True )
180183 return description_xml
@@ -256,7 +259,7 @@ def _get_version_information():
256259 return [python_version , sklearn_version , numpy_version , scipy_version ]
257260
258261
259- def _to_dict (taskid , flow_id , setup_string , parameter_settings , tags ):
262+ def _to_dict (taskid , flow_id , setup_string , error_message , parameter_settings , tags ):
260263 """ Creates a dictionary corresponding to the desired xml desired by openML
261264
262265 Parameters
@@ -280,6 +283,8 @@ def _to_dict(taskid, flow_id, setup_string, parameter_settings, tags):
280283 description ['oml:run' ]['@xmlns:oml' ] = 'http://openml.org/openml'
281284 description ['oml:run' ]['oml:task_id' ] = taskid
282285 description ['oml:run' ]['oml:flow_id' ] = flow_id
286+ if error_message is not None :
287+ description ['oml:run' ]['oml:error_message' ] = error_message
283288 description ['oml:run' ]['oml:parameter_setting' ] = parameter_settings
284289 description ['oml:run' ]['oml:tag' ] = tags # Tags describing the run
285290 # description['oml:run']['oml:output_data'] = 0;
0 commit comments