class_docstr: Generator for Thompson sampling.
  
  The generator performs Thompson sampling on the data passed in via `fit`.
  Arms are given weight proportional to the probability that they are
  winners, according to Monte Carlo simulations.
class_docstr_tok: ["Generator","for","Thompson","sampling",".","The","generator","performs","Thompson","sampling","on","the","data","passed","in","via","`","fit","`",".","Arms","are","given","weight","proportional","to","the","probability","that","they","are","winners",",","according","to","Monte","Carlo","simulations","."]
code: def predict(
      self, X: List[TParamValueList]
  ) -> Tuple[np.ndarray, np.ndarray]:
      n = len(
          X
      )  # number of parameterizations at which to make predictions
      m = len(self.Ys)  # number of outcomes
      f = np.zeros((n, m))  # array of outcome predictions
      cov = np.zeros((n, m, m))  # array of predictive covariances
      predictX = [self._hash_TParamValueList(x) for x in X]
      for i, X_to_Y_and_Yvar in enumerate(self.X_to_Ys_and_Yvars):
          # iterate through outcomes
          for j, x in enumerate(predictX):
              # iterate through parameterizations at which to make predictions
              if x not in X_to_Y_and_Yvar:
                  raise ValueError(
                      "ThompsonSampler does not support out-of-sample prediction."
                  )
              f[j, i], cov[j, i, i] = X_to_Y_and_Yvar[x]
      return f, cov
  
imports: import hashlib
  import json
  from typing import Dict, List, Optional, Tuple
  import numpy
  from ax.core.types import TGenMetadata, TParamValue, TParamValueList
  from ax.exceptions.constants import TS_MIN_WEIGHT_ERROR, TS_NO_FEASIBLE_ARMS_ERROR
  from ax.exceptions.model import ModelError
  from ax.models.discrete_base import DiscreteModel
  from ax.models.types import TConfig
  from ax.utils.common.docutils import copy_doc
label_desc: Use image node_id 4 for calling the ThompsonSampler obj's underlying member method code with example usage: obj.predict(X) and returns: f,  cov