docstr: Compute outlier scores and transform into outlier predictions.
  
  Parameters
  ----------
  df
      DataFrame with columns `ds` with timestamps and `y` with values which
      need to be flagged as outlier or not.
  return_instance_score
      Whether to return instance level outlier scores.
  return_forecast
      Whether to return the model forecast.
  
  Returns
  -------
  Dictionary containing ``'meta'`` and ``'data'`` dictionaries.
      - ``'meta'`` has the model's metadata.
      - ``'data'`` contains the outlier predictions, instance level outlier scores and the model forecast.
docstr_tok: ["Compute","outlier","scores","and","transform","into","outlier","predictions",".","Parameters","--","--","--","--","--","df","DataFrame","with","columns","`","ds","`","with","timestamps","and","`","y","`","with","values","which","need","to","be","flagged","as","outlier","or","not",".","return_instance_score","Whether","to","return","instance","level","outlier","scores",".","return_forecast","Whether","to","return","the","model","forecast",".","Returns","--","--","--","-","Dictionary","containing","``","'meta","'","``","and","``","'data","'","``","dictionaries",".","-","``","'meta","'","``","has","the","model","'s","metadata",".","-","``","'data","'","``","contains","the","outlier","predictions",",","instance","level","outlier","scores","and","the","model","forecast","."]
code: def predict(
      self,
      df: pd.DataFrame,
      return_instance_score: bool = True,
      return_forecast: bool = True,
  ) -> Dict[Dict[str, str], Dict[pd.DataFrame, pd.DataFrame]]:
      """
      Compute outlier scores and transform into outlier predictions.
  
      Parameters
      ----------
      df
          DataFrame with columns `ds` with timestamps and `y` with values which
          need to be flagged as outlier or not.
      return_instance_score
          Whether to return instance level outlier scores.
      return_forecast
          Whether to return the model forecast.
  
      Returns
      -------
      Dictionary containing ``'meta'`` and ``'data'`` dictionaries.
          - ``'meta'`` has the model's metadata.
          - ``'data'`` contains the outlier predictions, instance level outlier scores and the model forecast.
      """
      # compute outlier scores
      forecast = self.score(df)
      iscore = pd.DataFrame(
          data={
              "ds": df["ds"].values,
              "instance_score": forecast["score"],
          }
      )
  
      # values above threshold are outliers
      outlier_pred = pd.DataFrame(
          data={
              "ds": df["ds"].values,
              "is_outlier": (forecast["score"] > 0.0).astype(int),
          }
      )
  
      # populate output dict
      od = outlier_prediction_dict()
      od["meta"] = self.meta
      od["data"]["is_outlier"] = outlier_pred
      if return_instance_score:
          od["data"]["instance_score"] = iscore
      if return_forecast:
          od["data"]["forecast"] = forecast
      return od
  
file_path: alibi-detect/alibi_detect/od/prophet.py
imports: from prophet import Prophet
  import logging
  import pandas
  from typing import Dict, List, Union
  from alibi_detect.base import BaseDetector, FitMixin, outlier_prediction_dict
label_desc: Use image node_id 4 for calling the OutlierProphet obj's underlying member method code with example usage: obj.predict(df, return_instance_score, return_forecast) and returns: od