Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Institut für Informatik
dbis
software
dbispipeline
Commits
f0b11e1c
Commit
f0b11e1c
authored
Mar 10, 2021
by
Benjamin Murauer
Browse files
added support for pipelinehlper at root of model
parent
eaa71dd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dbispipeline/analytics.py
View file @
f0b11e1c
...
...
@@ -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
}
'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment