Last active
September 6, 2022 03:55
-
-
Save kvnkho/15d910ff7353344bb16837d07e28ba0a to your computer and use it in GitHub Desktop.
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
from fugue import transform | |
def forecast_series(df: pd.DataFrame, models) -> pd.DataFrame: | |
tdf = df.set_index("unique_id") | |
model = StatsForecast(df=tdf, models=models, freq='D', n_jobs=1) | |
return model.forecast(7).reset_index() | |
transform(series.reset_index(), | |
forecast_series, | |
params=dict(models=[AutoARIMA()]), | |
schema="unique_id:int, ds:date, AutoARIMA:float", | |
partition={"by": "unique_id"}, | |
engine="spark" | |
).show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment