Skip to content

Instantly share code, notes, and snippets.

@StevenReitsma
Created February 23, 2018 11:47
Show Gist options
  • Save StevenReitsma/8fb073640b43834df025f7d1272838a1 to your computer and use it in GitHub Desktop.
Save StevenReitsma/8fb073640b43834df025f7d1272838a1 to your computer and use it in GitHub Desktop.
Blogpost-Heineken6
from bdranalytics.pandaspipeline.transformers import PdFeatureChain
pipeline_pd = PdFeatureChain([
('wna', WeekNumberAdder(datecol='date')),
('svc', SmoothedVarCreator(var='weekly_sales', groupby_keys=['store', 'dept'], alpha_list=[0.1, 0.3])),
('lc1', LagCreator(groupby_keys=['store', 'dept', 'weeknumber'], lagdict=lagdict_yearly, drop_cols=False, suffix='ly')),
('lc2', LagCreator(groupby_keys=['store', 'dept'], lagdict=lagdict))
])
df_features = pipeline_pd.transform(df_base).dropna()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment