https://github.com/nixtla logo
#general
Title
# general
r

Rachel Yee

05/10/2023, 2:08 PM
Hi all, for mlforecast target transform, how does it work? For example if I want to use standardscaler on target variables and perform cross validation, does it just apply standard scaler to individual time series training data and transform the individual series forecasts back? My main concern is data leakage and whether applying standard scaler can account for the different scale for multiple time series.
f

fede (nixtla) (they/them)

05/10/2023, 7:54 PM
hey @Rachel Yee! Thanks for using mlforecast. You can define a specific
Transform
class to standardize individual time series before fitting and predicting (this accounts for different scales). But you can also specify a
Transform
class to standardize the series globally if you prefer. Here’s an example (standardizing each individual series): https://nixtla.github.io/mlforecast/docs/end_to_end_walkthrough.html#target-transformations. Regarding the
cross_validation
method, the splits are done before fitting the models. Therefore the transformations are only applied to the training data of the specific window. Please let us know if something else needs to be clarified. :)
3 Views