MultiNormalizer¶
- class pytorch_forecasting.data.encoders.MultiNormalizer(normalizers: List[pytorch_forecasting.data.encoders.TorchNormalizer])[source]¶
Bases:
pytorch_forecasting.data.encoders.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
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.
inverse_preprocess
(y)Inverse preprocess re-scaled data (e.g.
inverse_transform
(y)Inverse scale.
preprocess
(y)Preprocess input data (e.g.
set_params
(**params)Set the parameters of this estimator.
transform
(y[, X, return_norm, target_scale])Scale input data.
Attributes
TRANSFORMATIONS
- fit(y: Union[pandas.core.frame.DataFrame, numpy.ndarray, torch.Tensor], X: Optional[pandas.core.frame.DataFrame] = 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[torch.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: Union[pandas.core.frame.DataFrame, numpy.ndarray, torch.Tensor], X: Optional[pandas.core.frame.DataFrame] = None, return_norm: bool = False, target_scale: Optional[List[torch.Tensor]] = None) Union[List[Tuple[Union[numpy.ndarray, torch.Tensor], numpy.ndarray]], List[Union[numpy.ndarray, torch.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]]]