class_docstr: This class enables Greykite based anomaly detection algorithms.
      It takes a ``forecast_config`` and ``ad_config`` (see Parameters) and builds a detector which
      uses the forecast as baseline.
  
      The fit consists of following stages:
  
      - Fit a forecast model using the ``forecast_config`` passed
      - Fit a volatility model using
          `~greykite.algo.uncertainty.conditional.conf_interval.conf_interval`
          to optimize over
  
          -- ``volatility_features_list``
          -- ``coverage_grid``
  
          specified in ``ad_config`` passed.
  
  Parameters
  ----------
  ad_config: `~greykite.detection.detector.config.ADConfig` or None, default None
      Config object for anomaly detection to use.
  forecast_config : `~greykite.framework.templates.model_templates.ForecastConfig` or None, default None
      Config object for forecast to use.
  reward : See docstring for
      `~greykite.detection.detector.detector.Detector`
  
  Attributes
  ----------
  anomaly_percent_dict : `dict` or None,
      See attributes of `~greykite.detection.detector.detector.Detector`
  forecast_result : `~greykite.framework.pipeline.pipeline.ForecastResult` or None
      See class:`~greykite.framework.pipeline.pipeline.ForecastResult`
      for details.
  forecast_estimator : `~greykite.sklearn.estimator.base_forecast_estimator.BaseForecastEstimator` or None
      See class: `~greykite.sklearn.estimator.base_forecast_estimator.BaseForecastEstimator`
      for more details.
  ci_model : `dict`
      This is the fitted volatility model which is the returned dictionary from
      `greykite.algo.uncertainty.conditional.conf_interval`.
  fit_info : `dict` or None
      See attributes of `~greykite.detection.detector.detector.Detector`.
  anomaly_df : `pandas.DataFrame` or None
      A dataframe which includes the start and end times of observed anomalies.
  fit_data : `~greykite.detection.detector.data.DetectorData` or None
      The data used in the `fit` method.
class_docstr_tok: ["This","class","enables","Greykite","based","anomaly","detection","algorithms",".","It","takes","a","``","forecast_config","``","and","``","ad_config","``","(","see","Parameters",")","and","builds","a","detector","which","uses","the","forecast","as","baseline",".","The","fit","consists","of","following","stages",":","-","Fit","a","forecast","model","using","the","``","forecast_config","``","passed","-","Fit","a","volatility","model","using","`","~greykite.algo.uncertainty.conditional.conf_interval.conf_interval","`","to","optimize","over","--","``","volatility_features_list","``","--","``","coverage_grid","``","specified","in","``","ad_config","``","passed",".","Parameters","--","--","--","--","--","ad_config",":","`","~greykite.detection.detector.config.ADConfig","`","or","None",",","default","None","Config","object","for","anomaly","detection","to","use",".","forecast_config",":","`","~greykite.framework.templates.model_templates.ForecastConfig","`","or","None",",","default","None","Config","object","for","forecast","to","use",".","reward",":","See","docstring","for","`","~greykite.detection.detector.detector.Detector","`","Attributes","--","--","--","--","--","anomaly_percent_dict",":","`","dict","`","or","None",",","See","attributes","of","`","~greykite.detection.detector.detector.Detector","`","forecast_result",":","`","~greykite.framework.pipeline.pipeline.ForecastResult","`","or","None","See","class",":","`","~greykite.framework.pipeline.pipeline.ForecastResult","`","for","details",".","forecast_estimator",":","`","~greykite.sklearn.estimator.base_forecast_estimator.BaseForecastEstimator","`","or","None","See","class",":","`","~greykite.sklearn.estimator.base_forecast_estimator.BaseForecastEstimator","`","for","more","details",".","ci_model",":","`","dict","`","This","is","the","fitted","volatility","model","which","is","the","returned","dictionary","from","`","greykite.algo.uncertainty.conditional.conf_interval","`",".","fit_info",":","`","dict","`","or","None","See","attributes","of","`","~greykite.detection.detector.detector.Detector","`",".","anomaly_df",":","`","pandas.DataFrame","`","or","None","A","dataframe","which","includes","the","start","and","end","times","of","observed","anomalies",".","fit_data",":","`","~greykite.detection.detector.data.DetectorData","`","or","None","The","data","used","in","the","`","fit","`","method","."]
docstr: Returns a summary of the fitted model.
  Fetches the summary from the forecast estimator and adds it to the summary
  of the base class.
docstr_tok: ["Returns","a","summary","of","the","fitted","model",".","Fetches","the","summary","from","the","forecast","estimator","and","adds","it","to","the","summary","of","the","base","class","."]
code: def summary(self):
      """Returns a summary of the fitted model.
      Fetches the summary from the forecast estimator and adds it to the summary
      of the base class.
      """
      content = super().summary()
      content += self.forecast_estimator.summary().__str__()
  
      return content
  
imports: from copy import deepcopy
  import numpy
  import pandas
  from greykite.algo.uncertainty.conditional.conf_interval import conf_interval
  from greykite.algo.uncertainty.conditional.conf_interval import predict_ci
  from greykite.common.constants import ACTUAL_COL
  from greykite.common.constants import ANOMALY_COL
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import ERR_STD_COL
  from greykite.common.constants import PREDICTED_ANOMALY_COL
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import QUANTILE_SUMMARY_COL
  from greykite.common.constants import RESIDUAL_COL
  from greykite.common.constants import START_TIME_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.evaluation import ElementwiseEvaluationMetricEnum
  from greykite.common.features.adjust_anomalous_data import adjust_anomalous_data
  from greykite.common.features.timeseries_features import add_daily_events
  from greykite.common.features.timeseries_features import add_time_features_df
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
  from greykite.common.time_properties import describe_timeseries
  from greykite.common.time_properties import get_canonical_data
  from greykite.common.time_properties import infer_freq
  from greykite.detection.detector.ad_utils import add_new_params_to_records
  from greykite.detection.detector.ad_utils import get_anomaly_df
  from greykite.detection.detector.ad_utils import get_anomaly_df_from_outliers
  from greykite.detection.detector.ad_utils import get_canonical_anomaly_df
  from greykite.detection.detector.config import ADConfig
  from greykite.detection.detector.config_to_reward import config_to_reward
  from greykite.detection.detector.constants import DEFAULT_COVERAGE_GRID
  from greykite.detection.detector.constants import PHASE_PREDICT
  from greykite.detection.detector.constants import Z_SCORE_COL
  from greykite.detection.detector.detector import Detector
  from greykite.detection.detector.optimizer import CalcResult
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import MetadataParam
  from greykite.framework.templates.forecaster import Forecaster
label_desc: Use image node_id 5 for calling the GreykiteDetector obj's underlying member method code with example usage: obj.summary() and returns: content