ScaledLogitTransformer
Scaled logit transform or Log transform.
If both lower_bound and upper_bound are not None, a scaled logit transform is applied to the data. Otherwise, the transform applied is a log transform variation that ensures the resulting values from the inverse transform are bounded accordingly. The transform is applied to all scalar elements of the input array individually.
Combined with an sktime.forecasting.compose.TransformedTargetForecaster, it ensures that the forecast stays between the specified bounds (lower_bound, upper_bound).
Default is lower_bound = upper_bound = None, i.e., the identity transform.
The logarithm transform is obtained for lower_bound = 0, upper_bound = None.
Schnellstart
from sktime.transformations.scaledlogit import ScaledLogitTransformer
estimator = ScaledLogitTransformer(lower_bound=None, upper_bound=None)Parameter(2)
- lower_boundfloat, optional, default=None
- lower bound of inverse transform function
- upper_boundfloat, optional, default=None
- upper bound of inverse transform function
Beispiele
>>> import numpy as np
>>> from sktime.datasets import load_airline
>>> from sktime.transformations.scaledlogit import ScaledLogitTransformer
>>> from sktime.forecasting.trend import PolynomialTrendForecaster
>>> from sktime.forecasting.compose import TransformedTargetForecaster
>>> y = load_airline ()
>>> fcaster = TransformedTargetForecaster ([
... ("scaled_logit", ScaledLogitTransformer (0, 650)),
... ("poly", PolynomialTrendForecaster (degree = 2))
... ])
>>> fcaster. fit (y) TransformedTargetForecaster(
... )
>>> y_pred = fcaster. predict (fh = np. arange (32))Referenzen
Hyndsight - Forecasting within limits: https://robjhyndman.com/hyndsight/forecasting-within-limits/
Hyndman, R.J., & Athanasopoulos, G. (2021) Forecasting: principles and practice, 3rd edition, OTexts: Melbourne, Australia. OTexts.com/fpp3. Accessed on January 24th 2022.