Skip to content

Commit

Permalink
fixed in benchmarking notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
attilabalint committed Sep 19, 2024
1 parent 25b95bb commit deb8c71
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions notebooks/04. Benchmarking.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"source": [
"edd.metadata_subset.read().freq.unique()\n",
"print(f\"Available frequencies in the {edd.__class__.__name__}: {edd.metadata_subset.read().freq.unique().tolist()}\")\n",
"print(f\"Number of buildings in the {pvd.__class__.__name__}: {pvd.metadata_subset.read().freq.unique().tolist()}\")\n",
"print(f\"Number of buildings in the {gdd.__class__.__name__}: {gdd.metadata_subset.read().freq.unique().tolist()}\")"
"print(f\"Available frequencies in the {pvd.__class__.__name__}: {pvd.metadata_subset.read().freq.unique().tolist()}\")\n",
"print(f\"Available frequencies in the {gdd.__class__.__name__}: {gdd.metadata_subset.read().freq.unique().tolist()}\")"
],
"id": "89fa8501c79bd935",
"outputs": [],
Expand Down Expand Up @@ -292,7 +292,7 @@
{
"metadata": {},
"cell_type": "code",
"source": "leaderboard = pd.DataFrame()",
"source": "ed_leaderboard = pd.DataFrame()",
"id": "fc08a2dc7a840ab7",
"outputs": [],
"execution_count": null
Expand Down Expand Up @@ -327,7 +327,7 @@
"model = SeasonalNaiveModel(seasonality='1D')\n",
"model_results_df = benchmark_model(dataset, buildings, model, cv_folds=cv_folds, cv_step=cv_step, cv_horizon=cv_horizon)\n",
"model_results_df['rMAE'] = (model_results_df / baseline_results_df).loc[:, \"MAE\"]\n",
"leaderboard['DailyNaiveSeasonal'] = model_results_df.mean()"
"ed_leaderboard['DailyNaiveSeasonal'] = model_results_df.mean()"
],
"id": "d5bd62abc9d74384",
"outputs": [],
Expand All @@ -340,7 +340,7 @@
"model = SeasonalNaiveModel(seasonality='7D')\n",
"model_results_df = benchmark_model(dataset, buildings, model, cv_folds=cv_folds, cv_step=cv_step, cv_horizon=cv_horizon)\n",
"model_results_df['rMAE'] = (model_results_df / baseline_results_df).loc[:, \"MAE\"]\n",
"leaderboard['WeeklyNaiveSeasonal'] = model_results_df.mean()"
"ed_leaderboard['WeeklyNaiveSeasonal'] = model_results_df.mean()"
],
"id": "b24aa0b7833cf4cc",
"outputs": [],
Expand Down Expand Up @@ -383,7 +383,7 @@
"model = HistoricAverageModel()\n",
"model_results_df = benchmark_model(dataset, buildings, model, cv_folds=cv_folds, cv_step=cv_step, cv_horizon=cv_horizon)\n",
"model_results_df['rMAE'] = (model_results_df / baseline_results_df).loc[:, \"MAE\"]\n",
"leaderboard['HistoricAverage'] = model_results_df.mean()"
"ed_leaderboard['HistoricAverage'] = model_results_df.mean()"
],
"id": "c5592bb9a3be7f91",
"outputs": [],
Expand Down Expand Up @@ -436,7 +436,7 @@
"model = SeasonalWindowAverageModel(\"1D\", 28)\n",
"model_results_df = benchmark_model(dataset, buildings, model, cv_folds=cv_folds, cv_step=cv_step, cv_horizon=cv_horizon)\n",
"model_results_df['rMAE'] = (model_results_df / baseline_results_df).loc[:, \"MAE\"]\n",
"leaderboard['SeasonalWindowAverageS1DW28'] = model_results_df.mean()"
"ed_leaderboard['SeasonalWindowAverageS1DW28'] = model_results_df.mean()"
],
"id": "86312b6c8b3875aa",
"outputs": [],
Expand All @@ -449,7 +449,7 @@
"model = SeasonalWindowAverageModel(\"7D\", 4)\n",
"model_results_df = benchmark_model(dataset, buildings, model, cv_folds=cv_folds, cv_step=cv_step, cv_horizon=cv_horizon)\n",
"model_results_df['rMAE'] = (model_results_df / baseline_results_df).loc[:, \"MAE\"]\n",
"leaderboard['SeasonalWindowAverageS7DW4'] = model_results_df.mean()"
"ed_leaderboard['SeasonalWindowAverageS7DW4'] = model_results_df.mean()"
],
"id": "1c6a8dd0645623ae",
"outputs": [],
Expand All @@ -458,7 +458,7 @@
{
"metadata": {},
"cell_type": "code",
"source": "leaderboard.T.round(2).sort_values(\"rMAE\")",
"source": "ed_leaderboard.T.round(2).sort_values(\"rMAE\")",
"id": "edb26327f91c508b",
"outputs": [],
"execution_count": null
Expand All @@ -467,7 +467,7 @@
"metadata": {},
"cell_type": "code",
"source": [
"fig = leaderboard.T.sort_values(\"rMAE\", ascending=False).rMAE.plot(kind='barh', figsize=(10, 5), title='Leaderboard', xlabel='rMAE')\n",
"fig = ed_leaderboard.T.sort_values(\"rMAE\", ascending=False).rMAE.plot(kind='barh', figsize=(10, 5), title='Electricity Demand Leaderboard', xlabel='rMAE')\n",
"plt.show()"
],
"id": "ca53db6a92e74387",
Expand Down

0 comments on commit deb8c71

Please sign in to comment.