tspy.functions.segmenters module

main entry point for all segmentation transforms (given time-series return new segment-time-series)

tspy.functions.segmenters.cusum(threshold)

segment the time-series based on a CUSUM threshold being met

Parameters
thresholdfloat

the threshold which denotes a new segment

Returns
~tspy.data_structures.transforms.UnaryTransform

a cumulative-sum segmentation transform, which applied on a time-series using to_segments will create segments based on a threshold being exceeded from a CUSUM

tspy.functions.segmenters.dynamic_threshold(alpha, factor, threshold)

segment the time-series by a dynamic silence period

Parameters
alphafloat

denotes how much to weigh more recent inter-arrival-times

factor: float

a muliplication factor used to determine a dynamic threshold to denote a new segment

thresholdint

the threshold which denotes when a new segment should be created (inter-arrival-time > threshold)

Returns
~tspy.data_structures.transforms.UnaryTransform

a dynamic-threshold segmentation transform, which applied on a time-series using to_segments will create segments based on dynamic silence periods

tspy.functions.segmenters.regression(max_error, skip, use_relative=False)

segment the time-series based on a regression model error

Parameters
max_errorfloat

max error threshold

skipint

number of anomalies to allow

use_relativebool, optional

if True, will use the relative error, otherwise uses absolute error (default is absolute error)

Returns
~tspy.data_structures.transforms.UnaryTransform

a regression segmentation transform, which applied on a time-series using to_segments will create segments based on a regression model error

tspy.functions.segmenters.static_threshold(threshold)

segment the time-series by a static threshold silence period

Parameters
thresholdint

the threshold which denotes when a new segment should be created (inter-arrival-time > threshold)

Returns
~tspy.data_structures.transforms.UnaryTransform

a static-threshold segmentation transform, which applied on a time-series using to_segments will create segments based on silence periods

tspy.functions.segmenters.statistical_changepoint(min_segment_size=2, threshold=2.0)

segment the time-series based on a statistical change-point using z-normalization

Parameters
min_segment_sizeint, optional

minimum size of segment to allow (default is 2)

thresholdfloat, optional

difference threshold to denote change point (default is 2.0)

Returns
~tspy.data_structures.transforms.UnaryTransform

a statistical change-point segmentation transform, which applied on a time-series using to_segments will create segments based on a threshold being exceeded from a z-normalized time-series