docstr: Compute outlier scores and transform into outlier predictions.
  
  Parameters
  ----------
  X
      Uniformly sampled time series instances.
  t
      Equidistant timestamps corresponding to each input instances (i.e, the array should contain
      numerical values in increasing order). If not provided, the timestamps will be replaced by an array of
      integers `[0, 1, ... , N - 1]`, where `N` is the size of the input time series.
  return_instance_score
      Whether to return instance level outlier scores.
  
  Returns
  -------
  Dictionary containing `meta` and `data` dictionaries.
      - `meta` - has the model's metadata.
      - `data` - contains the outlier predictions and instance level outlier scores.
docstr_tok: ["Compute","outlier","scores","and","transform","into","outlier","predictions",".","Parameters","--","--","--","--","--","X","Uniformly","sampled","time","series","instances",".","t","Equidistant","timestamps","corresponding","to","each","input","instances","(","i.e",",","the","array","should","contain","numerical","values","in","increasing","order",")",".","If","not","provided",",","the","timestamps","will","be","replaced","by","an","array","of","integers","`","[","0",",","1",",","...",",","N","-","1","]","`",",","where","`","N","`","is","the","size","of","the","input","time","series",".","return_instance_score","Whether","to","return","instance","level","outlier","scores",".","Returns","--","--","--","-","Dictionary","containing","`","meta","`","and","`","data","`","dictionaries",".","-","`","meta","`","-","has","the","model","'s","metadata",".","-","`","data","`","-","contains","the","outlier","predictions","and","instance","level","outlier","scores","."]
code: def predict(
      self,
      X: np.ndarray,
      t: np.ndarray = None,
      return_instance_score: bool = True,
  ) -> Dict[Dict[str, str], Dict[np.ndarray, np.ndarray]]:
      """
      Compute outlier scores and transform into outlier predictions.
  
      Parameters
      ----------
      X
          Uniformly sampled time series instances.
      t
          Equidistant timestamps corresponding to each input instances (i.e, the array should contain
          numerical values in increasing order). If not provided, the timestamps will be replaced by an array of
          integers `[0, 1, ... , N - 1]`, where `N` is the size of the input time series.
      return_instance_score
          Whether to return instance level outlier scores.
  
      Returns
      -------
      Dictionary containing `meta` and `data` dictionaries.
          - `meta` - has the model's metadata.
          - `data` - contains the outlier predictions and instance level outlier scores.
      """
      if t is None:
          t = np.arange(X.shape[0])
  
      # compute outlier scores
      iscore = self.score(X, t)
  
      # values above threshold are outliers
      outlier_pred = (iscore > self.threshold).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
      return od
  
imports: import enum
  import logging
  import numpy
  from typing import Dict
  from alibi_detect.base import BaseDetector, ThresholdMixin, outlier_prediction_dict
  from alibi_detect.utils._types import Literal
label_desc: Use image node_id 8 for calling the SpectralResidual obj's underlying member method code with example usage: obj.predict(X, t, return_instance_score) and returns: od