class_docstr: This class implements APE (absolute percent error) based detector.
  The class finds the
  
  - best forecast among multiple forecasts which can be
      passed as baselines
  - as well as optimal APE threshold to use to denote an anomaly
  
  
  This class inherits its parameters and attributes from
  
  `~greykite.detection.detector.forecast_based.BestForecast`
  
  and all methods apply here as well. The only difference is: ``param_iterable``
  is not passed but constructed during the ``__init__``.
  
  
  Parameters
  ----------
  Solely inherited from
  `~greykite.detection.detector.forecast_based.BestForecast`
  except for the input parameter `param_iterable` which is constructed in the
  ``__init__``.
  
  Attributes
  ----------
  Solely inherited from
  `~greykite.detection.detector.forecast_based.BestForecast`
docstr: It assigns anomaly label to any points which has a larger mape
  than the threshold.
  
  Parameters
  ----------
  data : See class docstring
  
  Returns
  -------
  result : `pandas.DataFrame`
      Data frame with predictions added in a new column: ``PREDICTED_ANOMALY_COL``
code: def calc_with_param(self, param, data):
      """It assigns anomaly label to any points which has a larger mape
      than the threshold.
  
      Parameters
      ----------
      data : See class docstring
  
      Returns
      -------
      result : `pandas.DataFrame`
          Data frame with predictions added in a new column: ``PREDICTED_ANOMALY_COL``
      """
      pred_df = data.joined_dfs[param["forecast_id"]]
      y_pred = pred_df["ape"] > param["ape_thresh"]
      pred_df[PREDICTED_ANOMALY_COL] = y_pred
      data.y_pred = y_pred
      data.pred_df = pred_df
      return CalcResult(data=data)
  
file_path: greykite/greykite/detection/detector/ape_based.py
imports: import numpy
  from greykite.common.constants import PREDICTED_ANOMALY_COL
  from greykite.detection.detector.best_forecast import BestForecastDetector
  from greykite.detection.detector.optimizer import CalcResult
label_desc: Use image node_id 3 for calling the APEDetector obj's underlying member method code with example usage: obj.calc_with_param(param, data) and returns: CalcResult