Back to models
Transformer

WaveletPacketTransformer

Wavelet Packet Decomposition transformer.

Unlike the standard DWT which only decomposes the approximation branch at each level, wavelet packet decomposition recursively decomposes both approximation and detail branches, giving 2**level terminal sub-bands. This provides a richer frequency resolution.

Currently uses Haar wavelet coefficients internally.

Quickstart

python
from sktime.transformations.wavelet_packet import WaveletPacketTransformer

estimator = WaveletPacketTransformer(level=2, output_feature='energy')

Tags

Capabilities

  • Multivariate
  • Unequal-length series
  • Inverse transform: Not supported
  • Missing values: Not supported
  • Removes missing values: Not supported
  • Equalizes series length: Not supported

Properties

Input typescitype:transform-input
Series
Output typescitype:transform-output
Series
Label typescitype:transform-labels
None
Fit is emptyfit_is_empty
Yes
Keeps the time indextransform-returns-same-time-index
No
Requires Xrequires_X
Yes
Requires yrequires_y
No
X and y need the same indexX-y-must-have-same-index
No

Parameters(2)

levelint, default=2

Number of decomposition levels. Produces 2**level terminal sub-band nodes.

output_featurestr, default=”energy”

What to extract from each sub-band. One of:

  • "energy": sum of squared coefficients per node

  • "entropy": Shannon entropy of normalized coefficient power

  • "coefficients": concatenated raw packet coefficients

Examples

>>> from sktime.transformations.wavelet_packet import (
... WaveletPacketTransformer,
... )
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> t = WaveletPacketTransformer (level = 2, output_feature = "energy")
>>> y_features = t. fit_transform (y)