for key in model.cv_results_:
if key.startswith('param_'):
# supported types should include all types, including bool, int float
supported_types = (bool, int, float, six.string_types)
if all(isinstance(i, supported_types) or i is None for i in model.cv_results_[key]):
type = 'STRING'
else:
raise TypeError('Unsupported param type in param grid')
# we renamed the attribute param to parameter, as this is a required
# OpenML convention
attribute = ("parameter_" + key[6:], type)
trace_attributes.append(attribute)
return trace_attributes