Skip to content

Commit 0ea3842

Browse files
committed
Use yaml SafeLoader since more canonical
1 parent 82ae6d0 commit 0ea3842

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

automl_gs/utils_automl.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def build_hp_grid(framework, types, num_trials,
124124
"""
125125

126126
with open(hp_path) as f:
127-
hps = yaml.load(f, Loader=yaml.FullLoader)
127+
hps = yaml.safe_load(f)
128128

129129
# Refine hyperparameters by only using ones relevant to
130130
# the data and framework of choice
@@ -197,7 +197,7 @@ def render_model(params, model_name, framework, env, problem_type,
197197
text_framework = 'tensorflow' if framework == 'tensorflow' else 'sklearn'
198198

199199
with open(metrics_path) as f:
200-
metrics = yaml.load(f, Loader=yaml.FullLoader)[problem_type]
200+
metrics = yaml.safe_load(f)[problem_type]
201201

202202
for file in files:
203203
script = env.get_template('scripts/' + file.replace('.py', '')).render(
@@ -268,7 +268,7 @@ def get_problem_config(target_data,
268268

269269
# Direction
270270
with open(metrics_path) as f:
271-
metrics = yaml.load(f, Loader=yaml.FullLoader)
271+
metrics = yaml.safe_load(f)
272272

273273
direction = metrics[target_metric]['objective']
274274
direction_text = 'minimizing' if direction == 'min' else 'maximizing'

0 commit comments

Comments
 (0)