Skip to content

Commit

Permalink
Updated the every print with f-string
Browse files Browse the repository at this point in the history
I've updated all the print statements (also, cprint statements) with f-string
  • Loading branch information
ayushmorbar authored Feb 16, 2023
1 parent d3253fd commit 498fa03
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tab_automl/automl/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def single_model_trainer(self, x_train, y_train,
metric_scores = fetch_metric_scores((x_train, y_train),
(x_val, y_val), metrics=metric_list,
trained_model=model)
print("Model Metrics :")
print(f"Model Metrics :")
print({k: '%.5f'%v[0] for k, v in metric_scores.items()})
self.model_checkpoint(metric_scores, model_name, model)

Expand Down Expand Up @@ -108,7 +108,7 @@ def model_checkpoint(self, metric_dict, model_name, model):
flag = False
else:
if self.best_score < metric_dict[f"{self.check_on}_{self.result_monitor}"][0]:
cprint("Model Updated...", "green")
cprint(f"Model Updated...", "green")
cprint(f"Current best model : {model_name}", "green")
self.best_score = metric_dict[f"{self.check_on}_{self.result_monitor}"][0]
self.best_model_name = model_name
Expand All @@ -118,4 +118,4 @@ def model_checkpoint(self, metric_dict, model_name, model):
flag = False

if flag:
cprint("Model update failed...", "red")
cprint(f"Model update failed...", "red")

0 comments on commit 498fa03

Please sign in to comment.