class_docstr: In this algorithm, a sign test is performed by comparing data points to the baseline.
  The baseline can be adjusted with an offset and a percent gain. How it works:
  The data is compared within a fixed window and if the results differ significantly from random
  then all points in that window are considered to be an anomaly.
  
  A confidence is used for the statistical null test, 0.01 is the default p_value
  
  The entire time series is scanned with a sliding window and all points are scored.
  
  Either upper or lower threshold can be requested, but not both.
  The lower threshold should be negative if the intent is to measure a drop below baseline.
  For example, a lower threshold of -20 will detect a 20 percent decrease when compared against 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
   c) the test window must not be larger than the time series
docstr: sign test ccompares x to y counts how many are over
  do a rolling comparison over all x , y
  x is compared against shift + alpha * y
  :param x: values to be compared
  :param y: values to compared against
  :param k: how many values to compare default is 24 (5 minute intervals * 2 hours)
  :param alpha scaling for y in percents 0.5 = 5% increase
  :param shift: amount to shift baseline by
  :param conf: likelihood to use for anomaly
  :param gap: allowed gap between anomalies
docstr_tok: ["sign","test","ccompares","x","to","y","counts","how","many","are","over","do","a","rolling","comparison","over","all","x",",","y","x","is","compared","against","shift","+","alpha","*","y",":","param","x",":","values","to","be","compared",":","param","y",":","values","to","compared","against",":","param","k",":","how","many","values","to","compare","default","is","24","(","5","minute","intervals","*","2","hours",")",":","param","alpha","scaling","for","y","in","percents","0.5","=","5","%","increase",":","param","shift",":","amount","to","shift","baseline","by",":","param","conf",":","likelihood","to","use","for","anomaly",":","param","gap",":","allowed","gap","between","anomalies"]
code: def _rolling_sign_test(
      x, y, k=24, alpha=0.05, offset=0.0, conf=0.01, gap=0
  ):
      """
      sign test ccompares x to y counts how many are over
      do a rolling comparison over all x , y
      x is compared against shift + alpha * y
      :param x: values to be compared
      :param y: values to compared against
      :param k: how many values to compare default is 24 (5 minute intervals * 2 hours)
      :param alpha scaling for y in percents 0.5 = 5% increase
      :param shift: amount to shift baseline by
      :param conf: likelihood to use for anomaly
      :param gap: allowed gap between anomalies
      """
  
      if len(x) != len(y) or len(x) < k:
          return list()
  
      # our filter to convolve with - just counts
      f = np.ones(k)
  
      # threshold to be bigger than
      qthresh = qbinom(1 - conf, k) - 1
  
      # this is 1 if bigger 0 otherwise
      d = np.fmax(np.sign(x - offset - (1.0 + alpha) * y), 0)
  
      con = np.convolve(f, d, mode="valid")
  
      a = np.fmax(con - qthresh, 0)
  
      ranges = [(t[0], t[0] + k) for t in np.argwhere(a)]
  
      ranges = SignTest._merge_ranges(ranges, gap)
  
      # compute score
      probs = list()
      for s, e in ranges:
          count = sum(d[s:e])
          probs.append(pbinom(count, e - s))
  
      # compute confidence
      return zip(ranges, probs)
  
file_path: luminol/src/luminol/algorithms/anomaly_detector_algorithms/sign_test.py
imports: import numpy
  from luminol import exceptions
  from luminol.algorithms.anomaly_detector_algorithms import AnomalyDetectorAlgorithm
  from luminol.utils import qbinom, pbinom
  from luminol.modules.time_series import TimeSeries
label_desc: Use image node_id 4 for calling the SignTest obj's underlying member method code with example usage: obj._rolling_sign_test(x, y, k, alpha, offset, conf, gap) and returns: zip, list