class_docstr: Example:
      >>> #The dataset is split into x_train, x_test, y_train, y_test
      >>> forecaster = Forecaster(...)
      >>> forecaster.fit(x=x_train, y=y_train, ...)
      >>> y_pred = forecaster.predict(x_test)
      >>> td = ThresholdDetector()
      >>> td.fit(y_test, y_pred)
      >>> anomaly_scores = td.score()
      >>> anomaly_indexes = td.anomaly_indexes()
docstr: Initialize a ThresholdDetector.
docstr_tok: ["Initialize","a","ThresholdDetector","."]
code: def __init__(self):
      """
      Initialize a ThresholdDetector.
      """
      # to detect pattern anomaly, specify absolute distance threshold between y_true and y_pred
      self.pattern_th = math.inf
      # to detect trend anomaly, specify min and max threshold for y_true
      self.trend_th = (-math.inf, math.inf)
      self.ratio = 0.01
      self.dist_measure = EuclideanDistance()
      self.mode = "default"
      self.anomaly_indexes_ = None
      self.anomaly_scores_ = None
  
imports: import math
  import numpy
  from bigdl.chronos.detector.anomaly.abstract import AnomalyDetector
  from bigdl.nano.utils.common import invalidInputError
  from abc import ABC, abstractmethod
label_desc: Use image node_id 1 to create a new ThresholdDetector object from inherited base classes: AnomalyDetector with example: obj = ThresholdDetector()