docstr: Compute outlier scores.
  
  Parameters
  ----------
  df
      DataFrame with columns `ds` with timestamps and `y` with values which
      need to be flagged as outlier or not.
  
  Returns
  -------
  Array with outlier scores for each instance in the batch.
docstr_tok: ["Compute","outlier","scores",".","Parameters","--","--","--","--","--","df","DataFrame","with","columns","`","ds","`","with","timestamps","and","`","y","`","with","values","which","need","to","be","flagged","as","outlier","or","not",".","Returns","--","--","--","-","Array","with","outlier","scores","for","each","instance","in","the","batch","."]
code: def score(self, df: pd.DataFrame) -> pd.DataFrame:
      """
      Compute outlier scores.
  
      Parameters
      ----------
      df
          DataFrame with columns `ds` with timestamps and `y` with values which
          need to be flagged as outlier or not.
  
      Returns
      -------
      Array with outlier scores for each instance in the batch.
      """
      if self.cap:
          df["cap"] = self.cap
      forecast = self.model.predict(df)
      forecast["y"] = df["y"].values
      forecast["score"] = (forecast["y"] - forecast["yhat_upper"]) * (
          forecast["y"] >= forecast["yhat"]
      ) + (forecast["yhat_lower"] - forecast["y"]) * (
          forecast["y"] < forecast["yhat"]
      )
      return forecast
  
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 3 for calling the OutlierProphet obj's underlying member method code with example usage: obj.score(df) and returns: forecast