-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added visualizations and changed cutoff date to be the first forecast…
… date, rather than the last measured date
- Loading branch information
1 parent
d0bde3f
commit 32641a9
Showing
14 changed files
with
390 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import os | ||
|
||
import pandas as pd | ||
from statsforecast.models import MSTL | ||
|
||
|
@@ -11,7 +9,7 @@ | |
class MSTLModel: | ||
def info(self) -> ModelInfo: | ||
return ModelInfo( | ||
name=f"Statsforecast.MSTL.1D.7D", | ||
name="Statsforecast.MSTL.1D.7D", | ||
authors=[AuthorInfo(name="Attila Balint", email="[email protected]")], | ||
type=ForecasterType.quantile, | ||
params={ | ||
|
@@ -35,9 +33,9 @@ def forecast( | |
y = history.y.fillna(history.y.mean()) | ||
|
||
# Create model | ||
periods_in_1D = periods_in_duration(y.index, duration='1D') | ||
periods_in_7D = periods_in_duration(y.index, duration='7D') | ||
model = MSTL(season_length=[periods_in_1D, periods_in_7D]) | ||
periods_in_one_day = periods_in_duration(y.index, duration="1D") | ||
periods_in_one_week = periods_in_duration(y.index, duration="7D") | ||
model = MSTL(season_length=[periods_in_one_day, periods_in_one_week]) | ||
|
||
# Make forecast | ||
pred = model.forecast(y=y.values, h=horizon, level=level, **kwargs) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.