in sa-dsml-many-models/code/util/timeseries_utilities.py [0:0]
def fit(self, X, y=None):
"""
Fit the lagger transform.
This transform caches the tail of the training data up to the maximum lag order
so that lag features can be created on test data.
"""
assert self.target_column_name in X.columns, \
"Target column is missing from the input dataframe."
X_fit = X.sort_index(ascending=True)
max_lag_order = max(self.lag_orders)
self._train_tail = X_fit.iloc[-max_lag_order:]
self._column_order = self._train_tail.columns
return self