MultiNormalizer#
- class pytorch_forecasting.data.encoders.MultiNormalizer(normalizers: List[TorchNormalizer])[source]#
Bases:
TorchNormalizer
Normalizer for multiple targets.
This normalizers wraps multiple other normalizers.
- Parameters:
normalizers (List[TorchNormalizer]) – list of normalizers to apply to targets
- Inherited-members:
Methods
extra_repr
()fit
(y[, X])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.
get_transform
(transformation)Return transformation functions.
inverse_preprocess
(y)Inverse preprocess re-scaled data (e.g.
inverse_transform
(y)Inverse scale.
preprocess
(y)Preprocess input data (e.g.
set_output
(*[, transform])Set output container.
set_params
(**params)Set the parameters of this estimator.
transform
(y[, X, return_norm, target_scale])Scale input data.
Attributes
TRANSFORMATIONS
- fit(y: DataFrame | ndarray | Tensor, X: DataFrame | None = None)[source]#
Fit transformer, i.e. determine center and scale of data
- Parameters:
y (Union[pd.Series, np.ndarray, torch.Tensor]) – input data
- Returns:
self
- Return type:
- get_parameters(*args, **kwargs) List[Tensor] [source]#
Returns parameters that were used for encoding.
- Returns:
First element is center of data and second is scale
- Return type:
List[torch.Tensor]
- transform(y: DataFrame | ndarray | Tensor, X: DataFrame = None, return_norm: bool = False, target_scale: List[Tensor] = None) List[Tuple[ndarray | Tensor, ndarray]] | List[ndarray | Tensor] [source]#
Scale input data.
- Parameters:
y (Union[pd.DataFrame, np.ndarray, torch.Tensor]) – data to scale
X (pd.DataFrame) – dataframe with
groups
columns. Only necessary ifGroupNormalizer
is among normalizersreturn_norm (bool, optional) – If to return . Defaults to False.
target_scale (List[torch.Tensor]) – target scale to use instead of fitted center and scale
- Returns:
List of scaled data, if
return_norm=True
, returns also scales as second element- Return type:
Union[List[Tuple[Union[np.ndarray, torch.Tensor], np.ndarray]], List[Union[np.ndarray, torch.Tensor]]]