Skip to content

Commit d081fc2

Browse files
Katzmann1983Jens Humrichlokijota
authored
Fix evaluate issue (#381)
* update documentation * fix evaluate issue * linting Co-authored-by: Jens Humrich <[email protected]> Co-authored-by: João Pedro Martins <[email protected]>
1 parent d8e29cc commit d081fc2

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

diabetes_regression/evaluate/evaluate_model.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,21 @@
118118
production_model_mse = 10000
119119
if (metric_eval in model.tags):
120120
production_model_mse = float(model.tags[metric_eval])
121-
new_model_mse = float(run.parent.get_metrics().get(metric_eval))
121+
try:
122+
new_model_mse = float(run.parent.get_metrics().get(metric_eval))
123+
except TypeError:
124+
new_model_mse = None
122125
if (production_model_mse is None or new_model_mse is None):
123-
print("Unable to find", metric_eval, "metrics, "
126+
print("Unable to find ", metric_eval, " metrics, "
124127
"exiting evaluation")
125128
if((allow_run_cancel).lower() == 'true'):
126129
run.parent.cancel()
127130
else:
128131
print(
129-
"Current Production model mse: {}, "
130-
"New trained model mse: {}".format(
131-
production_model_mse, new_model_mse
132+
"Current Production model {}: {}, ".format(
133+
metric_eval, production_model_mse) +
134+
"New trained model {}: {}".format(
135+
metric_eval, new_model_mse
132136
)
133137
)
134138

0 commit comments

Comments
 (0)