EncoderNormalizer

class pytorch_forecasting.data.encoders.EncoderNormalizer(method: str = 'standard', center: bool = True, log_scale: Union[bool, float] = False, log_zero_value: float = - inf, coerce_positive: Union[float, bool] = None, eps: float = 1e-08)[source]

Bases: pytorch_forecasting.data.encoders.TorchNormalizer

Special Normalizer that is fit on each encoding sequence.

If passed as target normalizer, this transformer will be fitted on each encoder sequence separately.

Initialize

Parameters
  • method (str, optional) – method to rescale series. Either “standard” (standard scaling) or “robust” (scale using quantiles 0.25-0.75). Defaults to “standard”.

  • center (bool, optional) – If to center the output to zero. Defaults to True.

  • log_scale (bool, optional) – If to take log of values. Defaults to False. Defaults to False.

  • log_zero_value (float, optional) – Value to map 0 to for log_scale=True or in softplus. Defaults to -inf.

  • coerce_positive (Union[bool, float, str], optional) – If to coerce output to positive. Valid values: * None, i.e. is automatically determined and might change to True if all values are >= 0 (Default). * True, i.e. output is clamped at 0. * False, i.e. values are not coerced * float, i.e. softmax is applied with beta = coerce_positive.

  • eps (float, optional) – Number for numerical stability of calcualtions. Defaults to 1e-8. For count data, 1.0 is recommended.

Inherited-members

Methods

fit(y)

Fit transformer, i.e. determine center and scale of data.

fit_transform(X[, y])

Fit to data, then transform it.

get_parameters(*args, **kwargs)

Returns parameters that were used for encoding.

get_params([deep])

Get parameters for this estimator.

inverse_transform(y)

Inverse scale.

set_params(**params)

Set the parameters of this estimator.

transform(y[, return_norm, target_scale])

Rescale data.