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')

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)