Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leaderboard not loading #219 #224

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions dash/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,14 @@ def get_leaderboard_df(series_list, CV_score_function="MSE"):
chosen_methods = []

for series_title, forecast_data in forecast_series_dicts.items():
model_name = select_best_model(
forecast_data, CV_score_function=CV_score_function
)
chosen_methods.append(model_name)
try:
model_name = select_best_model(
forecast_data, CV_score_function=CV_score_function
)
chosen_methods.append(model_name)
except Exception as e:
print(f'{[series_title]} had the following error: {e}') # Usually missing forecasts
pass

stats_raw = pd.DataFrame({"Method": chosen_methods})

Expand Down
3 changes: 3 additions & 0 deletions dash/pages/leaderboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def update_leaderboard_df(CV_score):
construct the best model leaderboard based upon user selected scoring function
"""
# Build leaderboard with chosen CV scoring function
data_sources_json_file = open("../shared_config/data_sources.json")
series_list = json.load(data_sources_json_file)

counts = get_leaderboard_df(series_list, CV_score)

win_proportion = (
Expand Down
Loading