Seamlessly transform target values
Transformations applied per serie
Transformations applied to all series
GlobalSklearnTransformer
,
which takes a scikit-learn compatible transformer and applies it to all
series. Here’s an example on how to define a transformation that applies
logarithm to each value of the series + 1, which can help avoid
computing the log of 0.
Implementing your own target transformationsIn order to implement your own target transformation you have to define a class that inherits from
mlforecast.target_transforms.BaseTargetTransform
(this takes care of setting the column names as the id_col
, time_col
and target_col
attributes) and implement the fit_transform
and
inverse_transform
methods. Here’s an example on how to define a
min-max scaler.
target_transforms
argument.