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: Set parameters for ThresholdDetector
  
  :param mode: mode can be "default" or "gaussian".
      "default" : fit data according to a uniform distribution
      "gaussian": fit data according to a gaussian distribution
  :param ratio: the ratio of anomaly to consider as anomaly.
  :param pattern_threshold: a single value, specify absolute distance threshold between real
      data and predicted data to detect pattern anomaly.
  :param trend_threshold: a tuple composed of min_threshold and max_threshold, specify min
      and max threshold for real data to detect trend anomaly.
  :param dist_measure: measure of distance
docstr_tok: ["Set","parameters","for","ThresholdDetector",":","param","mode",":","mode","can","be","``","default","''","or","``","gaussian","''",".","``","default","''",":","fit","data","according","to","a","uniform","distribution","``","gaussian","''",":","fit","data","according","to","a","gaussian","distribution",":","param","ratio",":","the","ratio","of","anomaly","to","consider","as","anomaly",".",":","param","pattern_threshold",":","a","single","value",",","specify","absolute","distance","threshold","between","real","data","and","predicted","data","to","detect","pattern","anomaly",".",":","param","trend_threshold",":","a","tuple","composed","of","min_threshold","and","max_threshold",",","specify","min","and","max","threshold","for","real","data","to","detect","trend","anomaly",".",":","param","dist_measure",":","measure","of","distance"]
code: def set_params(
      self,
      mode="default",
      ratio=0.01,
      pattern_threshold=math.inf,
      trend_threshold=(-math.inf, math.inf),
      dist_measure=EuclideanDistance(),
  ):
      """
      Set parameters for ThresholdDetector
  
      :param mode: mode can be "default" or "gaussian".
          "default" : fit data according to a uniform distribution
          "gaussian": fit data according to a gaussian distribution
      :param ratio: the ratio of anomaly to consider as anomaly.
      :param pattern_threshold: a single value, specify absolute distance threshold between real
          data and predicted data to detect pattern anomaly.
      :param trend_threshold: a tuple composed of min_threshold and max_threshold, specify min
          and max threshold for real data to detect trend anomaly.
      :param dist_measure: measure of distance
      """
      self.ratio = ratio
      self.dist_measure = dist_measure
      self.mode = mode
      self.pattern_th = pattern_threshold
      invalidInputError(
          isinstance(trend_threshold, tuple)
          and len(trend_threshold) == 2,
          "Trend threshold is supposed to be a tuple of two elements.",
      )
      self.trend_th = trend_threshold
  
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 2 for calling the ThresholdDetector obj's underlying member method code with example usage: obj.set_params(mode, ratio, pattern_threshold, trend_threshold, dist_measure) without return types