docstr: Initializer
  :param time_series: a TimeSeries, a dictionary or a path to a csv file(str).
  :param baseline_time_series: a TimeSeries, a dictionary or a path to a csv file(str).
  :param bool score_only: if asserted, only anomaly scores are computed.
  :param float score_percent_threshold: percent threshold on anomaly score above which is considered an anomaly.
  :param str algorithm_name: name of the algorithm to use(file name).
  :param dict algorithm_params: additional params for the specific algorithm.
  :param str refine_algorithm_name: name of the refine algorithm to use(file name).
  :param dict refine_algorithm_params: additional params for the specific refine algorithm.
  :param AnomalyDetectorAlgorithm algorithm_class: A AnomalyDetectorAlgorithm class that when passed to luminol will
      be used to assign anomaly scores. This is useful when luminol user wants to use a custom algorithm.
docstr_tok: ["Initializer",":","param","time_series",":","a","TimeSeries",",","a","dictionary","or","a","path","to","a","csv","file","(","str",")",".",":","param","baseline_time_series",":","a","TimeSeries",",","a","dictionary","or","a","path","to","a","csv","file","(","str",")",".",":","param","bool","score_only",":","if","asserted",",","only","anomaly","scores","are","computed",".",":","param","float","score_percent_threshold",":","percent","threshold","on","anomaly","score","above","which","is","considered","an","anomaly",".",":","param","str","algorithm_name",":","name","of","the","algorithm","to","use","(","file","name",")",".",":","param","dict","algorithm_params",":","additional","params","for","the","specific","algorithm",".",":","param","str","refine_algorithm_name",":","name","of","the","refine","algorithm","to","use","(","file","name",")",".",":","param","dict","refine_algorithm_params",":","additional","params","for","the","specific","refine","algorithm",".",":","param","AnomalyDetectorAlgorithm","algorithm_class",":","A","AnomalyDetectorAlgorithm","class","that","when","passed","to","luminol","will","be","used","to","assign","anomaly","scores",".","This","is","useful","when","luminol","user","wants","to","use","a","custom","algorithm","."]
code: def __init__(
      self,
      time_series,
      baseline_time_series=None,
      score_only=False,
      score_threshold=None,
      score_percent_threshold=None,
      algorithm_name=None,
      algorithm_params=None,
      refine_algorithm_name=None,
      refine_algorithm_params=None,
      algorithm_class=None,
  ):
      """
      Initializer
      :param time_series: a TimeSeries, a dictionary or a path to a csv file(str).
      :param baseline_time_series: a TimeSeries, a dictionary or a path to a csv file(str).
      :param bool score_only: if asserted, only anomaly scores are computed.
      :param float score_percent_threshold: percent threshold on anomaly score above which is considered an anomaly.
      :param str algorithm_name: name of the algorithm to use(file name).
      :param dict algorithm_params: additional params for the specific algorithm.
      :param str refine_algorithm_name: name of the refine algorithm to use(file name).
      :param dict refine_algorithm_params: additional params for the specific refine algorithm.
      :param AnomalyDetectorAlgorithm algorithm_class: A AnomalyDetectorAlgorithm class that when passed to luminol will
          be used to assign anomaly scores. This is useful when luminol user wants to use a custom algorithm.
      """
  
      self.time_series = self._load(time_series)
      self.baseline_time_series = self._load(baseline_time_series)
      self.score_percent_threshold = (
          score_percent_threshold or DEFAULT_SCORE_PERCENT_THRESHOLD
      )
  
      # Prepare algorithms.
      algorithm_name = algorithm_name or ANOMALY_DETECTOR_ALGORITHM
      self.algorithm = algorithm_class or self._get_algorithm(
          algorithm_name
      )
      self.threshold = score_threshold or ANOMALY_THRESHOLD.get(
          algorithm_name
      )
      self.refine_algorithm = self._get_algorithm(
          refine_algorithm_name or ANOMALY_DETECTOR_REFINE_ALGORITHM
      )
  
      # Prepare parameters.
      self.algorithm_params = {
          "time_series": self.time_series,
          "baseline_time_series": self.baseline_time_series,
      }
      algorithm_params = algorithm_params or {}
      self.algorithm_params.update(algorithm_params)
      self.refine_algorithm_params = refine_algorithm_params or {}
  
      # Detect anomalies.
      self._detect(score_only)
  
file_path: luminol/src/luminol/anomaly_detector.py
imports: from luminol import exceptions, utils
  from luminol.algorithms.anomaly_detector_algorithms.all import anomaly_detector_algorithms
  from luminol.modules.anomaly import Anomaly
  from luminol.modules.time_series import TimeSeries
  from luminol.constants import ANOMALY_DETECTOR_ALGORITHM, ANOMALY_THRESHOLD, ANOMALY_DETECTOR_REFINE_ALGORITHM, DEFAULT_SCORE_PERCENT_THRESHOLD
label_desc: Use image node_id 1 to create a new AnomalyDetector object from inherited base classes: object with example: obj = AnomalyDetector(time_series, baseline_time_series, score_only, score_threshold, score_percent_threshold, algorithm_name, algorithm_params, refine_algorithm_name, refine_algorithm_params, algorithm_class)