Skip to content

Instantly share code, notes, and snippets.

@galenseilis
Last active December 15, 2023 10:56
Show Gist options
  • Save galenseilis/fc77fa6098107c6d1c58840efb8af89b to your computer and use it in GitHub Desktop.
Save galenseilis/fc77fa6098107c6d1c58840efb8af89b to your computer and use it in GitHub Desktop.
quickprophet example
import numpy as np
ds = pd.date_range('2023-01-01', '2027-03-02')
df = pd.DataFrame(dict(ds=ds, y=np.random.poisson(np.arange(ds.size) / 10 + 1)))
df = features.add_day_of_year_features(df, 'ds')
df['GROUP'] = ['ALL'] * ds.size
param_grid = {
'changepoint_prior_scale': [0.001],
'seasonality_prior_scale': [0.01],
'holidays_prior_scale': [0.01]
}
model = BatchCOVIDLogisticProphet(['GROUP'])
model.cv(df, param_grid=param_grid, cutoffs=generate_cutoffs(df)).fit(df).predict(100)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment