class_docstr: Derivative Algorithm.
  This method is the derivative version of Method 1.
  Instead of data point value, it uses the derivative of the data point.
docstr: Compute derivatives of the time series.
docstr_tok: ["Compute","derivatives","of","the","time","series","."]
code: def _compute_derivatives(self):
      """
      Compute derivatives of the time series.
      """
      derivatives = []
      for i, (timestamp, value) in enumerate(self.time_series_items):
          if i > 0:
              pre_item = self.time_series_items[i - 1]
              pre_timestamp = pre_item[0]
              pre_value = pre_item[1]
              td = timestamp - pre_timestamp
              derivative = (
                  (value - pre_value) / td
                  if td != 0
                  else value - pre_value
              )
              derivative = abs(derivative)
              derivatives.append(derivative)
      # First timestamp is assigned the same derivative as the second timestamp.
      if derivatives:
          derivatives.insert(0, derivatives[0])
      self.derivatives = derivatives
  
file_path: luminol/src/luminol/algorithms/anomaly_detector_algorithms/derivative_detector.py
imports: import numpy
  from luminol import utils
  from luminol.algorithms.anomaly_detector_algorithms import AnomalyDetectorAlgorithm
  from luminol.constants import DEFAULT_DERI_SMOOTHING_FACTOR
  from luminol.modules.time_series import TimeSeries
label_desc: Use image node_id 2 for calling the DerivativeDetector obj's underlying member method code with example usage: obj._compute_derivatives() without return types