Skip to content

Commit

Permalink
Merge pull request #42 from ayushmorbar/JWOC-2023
Browse files Browse the repository at this point in the history
Issue #3 Update every print statements to f-string
  • Loading branch information
Sherlock-221BBS authored Feb 17, 2023
2 parents ac94419 + 498fa03 commit da20afc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tab_automl/automl/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def __init__(self, path):
elif path.endswith(".csv"):
self.data = pd.read_csv(path)
else:
print("File type not supported")
print(f"File type not supported")
# storing the columns overview
self.columns = pd.Series([str(self.data[feature].dtype) for feature in self.data.columns])
self.labels = None
Expand Down Expand Up @@ -81,7 +81,7 @@ def __init__(self, path):
elif path.endswith(".csv"):
self.data = pd.read_csv(path)
else:
print("File type not supported")
print(f"File type not supported")

# storing the columns overview
self.columns = pd.Series([str(self.data[feature].dtype) for feature in self.data.columns])
Expand Down Expand Up @@ -131,7 +131,7 @@ def __init__(self, path):
elif path.endswith(".csv"):
self.data = pd.read_csv(path)
else:
print("File type not supported")
print(f"File type not supported")
# storing the columns overview
self.columns = pd.Series([str(self.data[feature].dtype) for feature in self.data.columns])
self.labels = None
Expand Down
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 da20afc

Please sign in to comment.