ballet.eng.ts module

class ballet.eng.ts.SingleLagger(lag, groupby_kwargs=None)[source]

Bases: ballet.eng.base.GroupedFunctionTransformer

Transformer that applies a lag operator to each group

Parameters
  • lag (int) – lag to apply

  • groupby_kwargs (Optional[dict]) – keyword arguments to pd.DataFrame.groupby

ballet.eng.ts.make_multi_lagger(lags, groupby_kwargs=None)[source]

Return a union of transformers that apply different lags

Parameters
  • lags (Iterable[int]) – collection of lags to apply

  • groupby_kwargs (Optional[dict]) – keyword arguments to pd.DataFrame.groupby

Return type

FeatureUnion