Skip to content

Commit

Permalink
Revert changes to electricity.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Wong authored and andywong36 committed Nov 17, 2023
1 parent 7930965 commit 7c14560
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions docs/examples/electricity.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.14.1
# jupytext_version: 1.13.0
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
Expand Down Expand Up @@ -96,9 +96,6 @@
# %%
df_elec.head()

# %%
df_elec.to_parquet("df_elec.pq")

# %% [markdown]
# Electricity-demand data can be challenging because of its complexity. In traditional forecasting applications, we divide our model into siloed processes that each contribute to separate behaviors of the time-series. For example:
#
Expand Down Expand Up @@ -351,9 +348,6 @@ def plot_2x2(df: pd.DataFrame,

plot_2x2(df_forecast_ex2)

# %%
df_forecast_ex2.to_parquet("df_forecast_ex2.pq")

# %% [markdown]
# Viewing the forecasts in this way helps us see a lingering serious issue: the annual seasonal pattern is very different for daytimes and nighttimes, but the model isn't capturing that.
#
Expand Down Expand Up @@ -382,7 +376,7 @@ def plot_2x2(df: pd.DataFrame,


# %% [markdown]
# Since we're working with more data, we'll need to use a dataloader (`torchcast` provides `TimeSeriesDataLoader`):
# Since we're working with more data, we'll need to use a dataloader (`torchcast` provies `TimeSeriesDataLoader`):

# %%
def make_dataloader(type_: str,
Expand Down Expand Up @@ -734,9 +728,6 @@ def configure_optimizers(self) -> torch.optim.Optimizer:
# %%
plot_2x2(df_forecast_nn.query("group==@example_group"))

# %%
df_forecast_nn.to_parquet("df_forecast_nn.pq")


# %% [markdown]
# Let's confirm quantitatively that the 2nd model does indeed substantially reduce forecast error, relative to the 'standard' model:
Expand Down Expand Up @@ -769,5 +760,3 @@ def inverse_transform(df: pd.DataFrame) -> pd.DataFrame:
merge(df_nn_err, on=['group', 'validation'], suffixes=('_es', '_es_nn'))



# %%

0 comments on commit 7c14560

Please sign in to comment.