Skip to content

Commit

Permalink
Check whether the metric exist when logging (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-wang-dl authored Nov 2, 2021
1 parent 87ad68d commit 787ceb3
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ def fit(self, df: pd.DataFrame) -> pd.DataFrame:
results_pd = pd.DataFrame({"model_json": model_json}, index=[0])
results_pd.reset_index(level=0, inplace=True)
for metric in self.SUPPORTED_METRICS:
results_pd[metric] = metrics[metric]
if metric in metrics.keys():
results_pd[metric] = metrics[metric]
else:
results_pd[metric] = np.nan
results_pd["prophet_params"] = str(best_result)

return results_pd

0 comments on commit 787ceb3

Please sign in to comment.