Skip to content

Instantly share code, notes, and snippets.

@erykml
Created July 28, 2022 20:29
Show Gist options
  • Save erykml/0b976c46534451afbf0ecb0eebd68b4c to your computer and use it in GitHub Desktop.
Save erykml/0b976c46534451afbf0ecb0eebd68b4c to your computer and use it in GitHub Desktop.
score_list = []
for fit_col in ["model_1", "model_2", "model_3"]:
scores = {
"model": fit_col,
"train_score": mean_absolute_error(
results_df.iloc[:TRAIN_END]["actuals"],
results_df.iloc[:TRAIN_END][fit_col]
),
"test_score": mean_absolute_error(
results_df.iloc[TRAIN_END:]["actuals"],
results_df.iloc[TRAIN_END:][fit_col]
)
}
score_list.append(scores)
scores_df = pd.DataFrame(score_list)
scores_df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment