docstr: Performs Fisher exact test(s), computing the p-value per feature.
  
  Parameters
  ----------
  x_ref
      Reference instances to compare distribution with. Data must consist of either [True, False]'s, or [0, 1]'s.
  x
      Batch of instances. Data must consist of either [True, False]'s, or [0, 1]'s.
  
  Returns
  -------
  Feature level p-values and odds ratios.
docstr_tok: ["Performs","Fisher","exact","test","(","s",")",",","computing","the","p-value","per","feature",".","Parameters","--","--","--","--","--","x_ref","Reference","instances","to","compare","distribution","with",".","Data","must","consist","of","either","[","True",",","False","]","'s",",","or","[","0",",","1","]","'s",".","x","Batch","of","instances",".","Data","must","consist","of","either","[","True",",","False","]","'s",",","or","[","0",",","1","]","'s",".","Returns","--","--","--","-","Feature","level","p-values","and","odds","ratios","."]
code: def feature_score(
      self, x_ref: np.ndarray, x: np.ndarray
  ) -> Tuple[np.ndarray, np.ndarray]:
      """
      Performs Fisher exact test(s), computing the p-value per feature.
  
      Parameters
      ----------
      x_ref
          Reference instances to compare distribution with. Data must consist of either [True, False]'s, or [0, 1]'s.
      x
          Batch of instances. Data must consist of either [True, False]'s, or [0, 1]'s.
  
      Returns
      -------
      Feature level p-values and odds ratios.
      """
      x = x.reshape(x.shape[0], -1).astype(dtype=np.int64)
      x_ref = x_ref.reshape(x_ref.shape[0], -1).astype(dtype=np.int64)
  
      # Check data is only [False, True] or [0, 1]
      values = set(np.unique(x))
      if not set(values).issubset(["0", "1", True, False]):
          raise ValueError(
              "The `x` data must consist of only [0,1]'s or [False,True]'s for the FETDrift detector."
          )
  
      # Perform FET for each feature
      n_ref = x_ref.shape[0]
      n = x.shape[0]
      sum_ref = np.sum(x_ref, axis=0)
      sum_test = np.sum(x, axis=0)
      p_val = np.empty(self.n_features)
      odds_ratio = np.empty_like(p_val)
      for f in range(self.n_features):
          table = np.array(
              [
                  [sum_test[f], sum_ref[f]],
                  [n - sum_test[f], n_ref - sum_ref[f]],
              ]
          )
          odds_ratio[f], p_val[f] = fisher_exact(
              table, alternative=self.alternative
          )
  
      return p_val, odds_ratio
  
imports: import numpy
  from typing import Callable, Dict, Tuple, Optional, Union
  from alibi_detect.cd.base import BaseUnivariateDrift
  from scipy.stats import fisher_exact
label_desc: Use image node_id 2 for calling the FETDrift obj's underlying member method code with example usage: obj.feature_score(x_ref, x) and returns: p_val,  odds_ratio