class_docstr: In this algorithm, anomalies are those data points that are above a percentage threshold as compared to the baseline.
  This algorithm assumes that time_series and baseline_time_series are perfectly aligned, meaning that:
   a) every timestamp that exists in time_series also exists in baseline_time_series
   b) lengths of both time series are same
class_docstr_tok: ["In","this","algorithm",",","anomalies","are","those","data","points","that","are","above","a","percentage","threshold","as","compared","to","the","baseline",".","This","algorithm","assumes","that","time_series","and","baseline_time_series","are","perfectly","aligned",",","meaning","that",":","a",")","every","timestamp","that","exists","in","time_series","also","exists","in","baseline_time_series","b",")","lengths","of","both","time","series","are","same"]
docstr: :param time_series: current time series
  :param baseline_time_series: baseline time series
  :param percent_threshold_upper: If time_series is larger than baseline_time_series by this percent, then its
  an anomaly
  :param percent_threshold_lower: If time_series is smaller than baseline_time_series by this percent, then its
  an anomaly
docstr_tok: [":","param","time_series",":","current","time","series",":","param","baseline_time_series",":","baseline","time","series",":","param","percent_threshold_upper",":","If","time_series","is","larger","than","baseline_time_series","by","this","percent",",","then","its","an","anomaly",":","param","percent_threshold_lower",":","If","time_series","is","smaller","than","baseline_time_series","by","this","percent",",","then","its","an","anomaly"]
code: def __init__(
      self,
      time_series,
      baseline_time_series,
      percent_threshold_upper=None,
      percent_threshold_lower=None,
  ):
      """
      :param time_series: current time series
      :param baseline_time_series: baseline time series
      :param percent_threshold_upper: If time_series is larger than baseline_time_series by this percent, then its
      an anomaly
      :param percent_threshold_lower: If time_series is smaller than baseline_time_series by this percent, then its
      an anomaly
      """
      super(DiffPercentThreshold, self).__init__(
          self.__class__.__name__, time_series, baseline_time_series
      )
      self.percent_threshold_upper = percent_threshold_upper
      self.percent_threshold_lower = percent_threshold_lower
      if (
          not self.percent_threshold_upper
          and not self.percent_threshold_lower
      ):
          raise exceptions.RequiredParametersNotPassed(
              "luminol.algorithms.anomaly_detector_algorithms.diff_percent_threshold: \
                      Either percent_threshold_upper or percent_threshold_lower needed"
          )
  
imports: from luminol import exceptions
  from luminol.algorithms.anomaly_detector_algorithms import AnomalyDetectorAlgorithm
  from luminol.modules.time_series import TimeSeries
label_desc: Use image node_id 1 to create a new DiffPercentThreshold object from inherited base classes: AnomalyDetectorAlgorithm with example: obj = DiffPercentThreshold(time_series, baseline_time_series, percent_threshold_upper, percent_threshold_lower)