Back to models
Detector

ThresholdDetector

Naive detector which detects all points outside a threshold.

Quickstart

python
from sktime.detection.naive import ThresholdDetector

estimator = ThresholdDetector(upper=1, lower='-upper', mode='segments')

Parameters(3)

upperfloat or None, optional, default=1
Upper bound of the threshold interval. If None, no upper bound is applied.
lowerfloat or None, optional, default=-upper
Lower bound of the threshold interval. If None, no lower bound is applied.
modestr, optional, one of “segments”, “points”, default=”segments”

Type of detection returned.

  • "segments": returns detected segments as pd.Interval iloc values.

  • "points": returns midpoints of detected segments, integer iloc values.

Examples

>>> import pandas as pd
>>> from sktime.detection.naive import ThresholdDetector
>>> y = pd. DataFrame ([1, 2, 3, 2, 1, 2, 3, 42, 43, 1, 2 ])
>>> d = ThresholdDetector (upper = 10, mode = "segments")
>>> y_pred = d. fit_predict (y)