Skip to content

Max Transform

The min transform computes the min of a window. When combined with the SlidingWindow abstraction, the min transform can be used to compute the min feature of a time series. The min is defined as:

\[ \text{min}(x) = \min_{i=1}^n x_i \]

where \(x\) is a vector of length \(n\).

Bases: Transform

Compute the min of the values in x.

__call__(signal_window, where=lambda : not np.isnan(x), initial=np.inf)

Compute the min of the signal window provided.

Parameters:

Name Type Description Default
signal_window ndarray

The signal window to find the min of.

required
where Callable[[Union[int, float, int_, float_]], Union[bool, bool_]]

A function that takes a value and returns True or False. Default is lambda x: not np.isnan(x) i.e. a measurement is valid if it is not a NaN value.

lambda : not numpy.isnan(x)
initial Union[int, float, int_, float_]

The initial value to use when computing the min. Default is np.inf.

inf

Returns:

Type Description
Union[float_, int_]

A scalar value representing the min of the signal.

Examples

import numpy as np
import autonfeat as aft

# Random data
n_samples = 100
x = np.random.rand(n_samples)

# Create sliding window
ws = 10
ss = 10
window = aft.SlidingWindow(window_size=ws, step_size=ss)

# Create transform
tf = aft.MinTransform()

# Get featurizer
featurizer = window.use(tf)

# Get features
features = featurizer(x)

# Print features
print(window)
print(tf)
print(features)

If you enjoy using AutonFeat, please consider starring the repository ⭐️.