Back to models
Transformer

HOG1DTransformer

HOG1D transform.

This class is to calculate the HOG1D transform of a dataframe of time series data. Works by splitting the time series num_intervals times, and calculate a histogram of gradients within each interval.

Quickstart

python
from sktime.transformations.hog1d import HOG1DTransformer

estimator = HOG1DTransformer(num_intervals=2, num_bins=8, scaling_factor=0.1)

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(3)

num_intervalsint, default=2
length of interval.
num_binsint, default=8
num bins in the histogram.
scaling_factorfloat, default=0.1
a constant that is multiplied to modify the distribution.

Examples

>>> from sktime.transformations.hog1d import HOG1DTransformer
>>> from sktime.datasets import load_arrow_head
>>> 
>>> X, y = load_arrow_head (return_X_y = True)
>>> 
>>> # Initialize the transformer
>>> hog1d_transformer = HOG1DTransformer (
... num_intervals = 5, num_bins = 8, scaling_factor = 0.1
... )
>>> 
>>> # Transform the data
>>> Xt = hog1d_transformer. fit_transform (X)