Skip to content

Commit 8bc6aff

Browse files
committed
updated report for auto-select
1 parent 71c3590 commit 8bc6aff

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ads/opctl/operator/lowcode/forecast/model/base_model.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,16 @@ def generate_report(self):
252252
output_dir = self.spec.output_directory.url
253253
backtest_report_name = "backtest_stats.csv"
254254
backtest_stats = pd.read_csv(f"{output_dir}/{backtest_report_name}")
255+
average_dict = backtest_stats.mean().to_dict()
256+
del average_dict['backtest']
257+
best_model = min(average_dict, key=average_dict.get)
255258
backtest_text = rc.Heading("Back Testing Metrics", level=2)
259+
summary_text = rc.Text(
260+
f"Overall, the average scores for the models are {average_dict}, with {best_model}"
261+
f" being identified as the top-performing model during backtesting.")
256262
backtest_table = rc.DataTable(backtest_stats, index=True)
257263
liner_plot = get_auto_select_plot(backtest_stats)
258-
backtest_sections = [backtest_text, backtest_table, liner_plot]
264+
backtest_sections = [backtest_text, backtest_table, summary_text, liner_plot]
259265

260266

261267
forecast_plots = []

0 commit comments

Comments
 (0)