Commit f0b11e1c authored by Benjamin Murauer's avatar Benjamin Murauer
Browse files

added support for pipelinehlper at root of model

parent eaa71dd9
......@@ -152,12 +152,18 @@ def _read_parameters(dictionary, prefix='', use_prefix=True):
return dictionary
result = {}
for k, v in dictionary.items():
# parameter contains a PipelineHelper, we need recursion
if '__selected_model' in k:
# PipelineHelper is the root of the model
if k == 'selected_model':
k = prefix + k if use_prefix else k
result[k] = str(v[0])
result.update(_read_parameters(v[1], v[0] + '__'))
# PipelineHelper is somewhere else
elif '__selected_model' in k:
# the [:-16] cuts off the string '__selected_model'
key_name = prefix + k[:-16] if use_prefix else k[:-16]
result[key_name] = str(v[0])
result.update(_read_parameters(v[1], f'{v[0]}__'))
result.update(_read_parameters(v[1], v[0] + '__'))
# "Regular" GridSearch element
else:
key_name = prefix + k if use_prefix else k
result[key_name] = f'{v}'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment