docstr: Predict whether instances are outliers or not.
  
  Parameters
  ----------
  X
      Batch of instances.
  outlier_type
      Predict outliers at the 'feature' or 'instance' level.
  outlier_perc
      Percentage of sorted feature level outlier scores used to predict instance level outlier.
  batch_size
      Batch size used when making predictions with the autoencoder.
  return_feature_score
      Whether to return feature level outlier scores.
  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 both feature and instance level outlier scores.
docstr_tok: ["Predict","whether","instances","are","outliers","or","not",".","Parameters","--","--","--","--","--","X","Batch","of","instances",".","outlier_type","Predict","outliers","at","the","'feature","'","or","'instance","'","level",".","outlier_perc","Percentage","of","sorted","feature","level","outlier","scores","used","to","predict","instance","level","outlier",".","batch_size","Batch","size","used","when","making","predictions","with","the","autoencoder",".","return_feature_score","Whether","to","return","feature","level","outlier","scores",".","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","both","feature","and","instance","level","outlier","scores","."]
code: def predict(
      self,
      X: np.ndarray,
      outlier_type: str = "instance",
      outlier_perc: float = 100.0,
      batch_size: int = int(1e10),
      return_feature_score: bool = True,
      return_instance_score: bool = True,
  ) -> Dict[Dict[str, str], Dict[np.ndarray, np.ndarray]]:
      """
      Predict whether instances are outliers or not.
  
      Parameters
      ----------
      X
          Batch of instances.
      outlier_type
          Predict outliers at the 'feature' or 'instance' level.
      outlier_perc
          Percentage of sorted feature level outlier scores used to predict instance level outlier.
      batch_size
          Batch size used when making predictions with the autoencoder.
      return_feature_score
          Whether to return feature level outlier scores.
      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 both feature and instance level outlier scores.
      """
      # compute outlier scores
      fscore, iscore = self.score(
          X, outlier_perc=outlier_perc, batch_size=batch_size
      )
      if outlier_type == "feature":
          outlier_score = fscore
      elif outlier_type == "instance":
          outlier_score = iscore
      else:
          raise ValueError(
              "`outlier_score` needs to be either `feature` or `instance`."
          )
  
      # values above threshold are outliers
      outlier_pred = (outlier_score > self.threshold).astype(int)
  
      # populate output dict
      od = outlier_prediction_dict()
      od["meta"] = self.meta
      od["data"]["is_outlier"] = outlier_pred
      if return_feature_score:
          od["data"]["feature_score"] = fscore
      if return_instance_score:
          od["data"]["instance_score"] = iscore
      return od
  
file_path: alibi-detect/alibi_detect/od/ae.py
imports: import logging
  import numpy
  import tensorflow
  from typing import Dict, Tuple
  from alibi_detect.models.tensorflow.autoencoder import AE
  from alibi_detect.models.tensorflow.trainer import trainer
  from alibi_detect.base import BaseDetector, FitMixin, ThresholdMixin, outlier_prediction_dict
  from alibi_detect.utils.tensorflow.prediction import predict_batch
  from alibi_detect.utils._types import OptimizerTF
label_desc: Use image node_id 7 for calling the OutlierAE obj's underlying member method code with example usage: obj.predict(X, outlier_type, outlier_perc, batch_size, return_feature_score, return_instance_score) and returns: od