Zurück zu den Modellen
Transformer

ADICVTransformer

Transformer categorizing series into ADI-CV2 classes after Syntetos/Boylan.

Transforms a time series into a category label, which is one of: "smooth", "erratic", "intermittent", or "lumpy".

The labels are based on the Average Demand Interval (ADI) and the Coefficient of Variation squared (CV^2) of the time series, using simple thresholding. Optionally, the transformer can return the ADI and CV^2 values as well.

Let \(x_t\) be the value of the time series at times \(t = 1, 2, \dots, T\), and let \(N\) be the number of non-zero values in the time series, i.e., \(N = \text{card}\{t: x_t \neq 0\}\).

The ADI and CV^2 are calculated as follows:

1. Average Demand Interval (ADI): The average number of periods between periods with non-zero demand, mathematically defined as:

\[ADI = \frac{T}{N}\]

2. Coefficient of Variation squared (CV^2): CV is calculated on non-zero values in the time series. Mathematical definition is:

\[CV2 = \frac{1}{N}\sum_{t=1}^{T} x_t^2 - \left(\frac{1}{N}\sum_{t=1}^{T} x_t\right)^2\]

3. Class: Classification of time series on basis of ADI threshold and CV^2 threshold.

For thresholds ADI_threshold and CV2_threshold, the classes are:

  1. Smooth: If ADI <= adi_threshold and CV2 <= cv2_threshold

  2. Erratic: If ADI <= adi_threshold and CV2 > cv2_threshold

  3. Intermittent: If ADI > adi_threshold and cv2 <= cv2_threshold

  4. Lumpy: if ADI > adi_threshold and CV2 > cv2_threshold

Default values for the thresholds are taken from the paper by Syntetos/Boylan [1]. namely, adi_threshold = 1.32 and cv2_threshold = 0.49. They can also be adjusted by passing them as parameters to the transformer.

Schnellstart

python
from sktime.transformations.adi_cv import ADICVTransformer

estimator = ADICVTransformer(features=None, adi_threshold=1.32, cv_threshold=0.49, adi_trim_handling='pool')

Parameter(4)

adi_thresholdfloat (default = 1.32)
Specifies the ADI threshold utilized for classifying the time series
cv2_thresholdfloat (default = 0.49)
Specifies the CV2 threshold utilized for classifying the time series
featureslist[str] | None (default = [‘adi’, ‘cv2’, ‘class’])
Specifies all of the feature values to be calculated
adi_trim_handling: string (default = pool)

Specifies the method for reconciling leading/trailing zeros in the series. Allowable values are (‘pool’, ‘trim’, and ‘ignore’), corresponding to the following treatment of leading/trailing zeros: pool => L / N trim => (Last N - First N) / N ignore => L / (N - 1)

  • where L is the set of All Observations, and N is the set of Non-Zero observations

Beispiele

>>> from sktime.transformations.adi_cv import ADICVTransformer
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> transformer = ADICVTransformer ()
>>> y_hat = transformer. fit_transform (y)

Referenzen

  1. [1]: John E. Boylan, Aris Syntetos: The Accuracy of Intermittent Demand Estimates. International Journal of Forecasting, 1 Apr. 2005