Skip to content

Commit

Permalink
Fix evaluate issue (#381)
Browse files Browse the repository at this point in the history
* update documentation

* fix evaluate issue

* linting

Co-authored-by: Jens Humrich <[email protected]>
Co-authored-by: João Pedro Martins <[email protected]>
  • Loading branch information
3 people authored Dec 14, 2021
1 parent d8e29cc commit d081fc2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions diabetes_regression/evaluate/evaluate_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,21 @@
production_model_mse = 10000
if (metric_eval in model.tags):
production_model_mse = float(model.tags[metric_eval])
new_model_mse = float(run.parent.get_metrics().get(metric_eval))
try:
new_model_mse = float(run.parent.get_metrics().get(metric_eval))
except TypeError:
new_model_mse = None
if (production_model_mse is None or new_model_mse is None):
print("Unable to find", metric_eval, "metrics, "
print("Unable to find ", metric_eval, " metrics, "
"exiting evaluation")
if((allow_run_cancel).lower() == 'true'):
run.parent.cancel()
else:
print(
"Current Production model mse: {}, "
"New trained model mse: {}".format(
production_model_mse, new_model_mse
"Current Production model {}: {}, ".format(
metric_eval, production_model_mse) +
"New trained model {}: {}".format(
metric_eval, new_model_mse
)
)

Expand Down

0 comments on commit d081fc2

Please sign in to comment.