class_docstr: Base object for permutations test
class_docstr_tok: ["Base","object","for","permutations","test"]
docstr: Performs the permutation test
  
  Parameters
  ----------
  X : array-like
      The data to fit. Can be, for example a list, or an array at
      least 2d.
  y : array-like
      The target variable to try to predict in the case of
      supervised learning.
  
  verbose : bool, default=True
      If true, print progress.
docstr_tok: ["Performs","the","permutation","test","Parameters","--","--","--","--","--","X",":","array-like","The","data","to","fit",".","Can","be",",","for","example","a","list",",","or","an","array","at","least","2d",".","y",":","array-like","The","target","variable","to","try","to","predict","in","the","case","of","supervised","learning",".","verbose",":","bool",",","default=True","If","true",",","print","progress","."]
code: def test(self, X, y, groups=None, verbose=True):
      """Performs the permutation test
  
      Parameters
      ----------
      X : array-like
          The data to fit. Can be, for example a list, or an array at
          least 2d.
      y : array-like
          The target variable to try to predict in the case of
          supervised learning.
  
      verbose : bool, default=True
          If true, print progress.
      """
      Npe = multiset_perm_number(y)
      self.scores_ = np.zeros(np.min([self.n_perms, int(Npe)]))
  
      # initial fit. This is usefull for transform data or for estimating
      # parameter that does not change across permutation, like the mean of
      # all data, the pairwise distance matrix, etc.
      X = self._initial_transform(X)
  
      # get the non permuted score
      self.scores_[0] = self.score(X, y, groups=groups)
  
      if Npe <= self.n_perms:
          print("Warning, number of unique permutations : %d" % Npe)
          perms = unique_permutations(y)
          ii = 0
          for perm in perms:
              if not np.array_equal(perm, y):
                  self.scores_[ii + 1] = self.score(
                      X, perm, groups=groups
                  )
                  ii += 1
                  if verbose:
                      self._print_progress(ii)
  
      else:
          rs = np.random.RandomState(self.random_state)
          for ii in range(self.n_perms - 1):
              perm = self._shuffle(y, groups, rs)
              self.scores_[ii + 1] = self.score(X, perm, groups=groups)
              if verbose:
                  self._print_progress(ii)
      if verbose:
          print("")
      self.p_value_ = (self.scores_[0] <= self.scores_).mean()
  
      return self.p_value_, self.scores_
  
imports: import sys
  import math
  import numpy
  from .utils.utils import check_version
  from .utils.distance import distance, pairwise_distance
  from .utils.mean import mean_covariance
  from .classification import MDM, _check_metric
label_desc: Use image node_id 1 for calling the BasePermutation obj's underlying member method code with example usage: obj.test(X, y, groups, verbose) and returns: self,  self