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.set_params(threshold=10)
      >>> 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 threshold: threshold, could be
  
      1. a single value - absolute distance threshold, same for all samples
  
      2. a tuple (min, max) - min and max are either int/float or tensors in same shape as y,
      yhat is ignored in this case
  :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","threshold",":","threshold",",","could","be","1.","a","single","value","-","absolute","distance","threshold",",","same","for","all","samples","2.","a","tuple","(","min",",","max",")","-","min","and","max","are","either","int\/float","or","tensors","in","same","shape","as","y",",","yhat","is","ignored","in","this","case",":","param","dist_measure",":","measure","of","distance"]
code: def set_params(
      self,
      mode="default",
      ratio=0.01,
      threshold=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 threshold: threshold, could be
  
          1. a single value - absolute distance threshold, same for all samples
  
          2. a tuple (min, max) - min and max are either int/float or tensors in same shape as y,
          yhat is ignored in this case
      :param dist_measure: measure of distance
      """
      self.ratio = ratio
      self.dist_measure = dist_measure
      self.mode = mode
      self.th = threshold
  
imports: import math
  import numpy
  from zoo.chronos.detector.anomaly.abstract import AnomalyDetector
  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, threshold, dist_measure) without return types