class_docstr: Permutation test using any scikit-learn model for scoring.
  
  Perform a permutation test using the cross-validation score of any
  scikit-learn compatible model. Score is obtained with `cross_val_score`
  from scikit-learn. The score should be a "higer is better" metric.
  
  Parameters
  ----------
  n_perms : int, default=100
      The number of permutation. The minimum should be 20 for a resolution of
      0.05 p-value.
  model : sklearn compatible model, default=MDM()
      The model for scoring.
  cv : int or cross-validation generator or an iterable, default=3
      Determines the cross-validation splitting strategy.
      Possible inputs for cv are:
  
      - None, to use the default 3-fold cross validation;
      - integer, to specify the number of folds in a `(Stratified)KFold`;
      - an object to be used as a cross-validation generator;
      - an iterable yielding train, test splits.
  
      For integer/None inputs, if the estimator is a classifier and `y` is
      either binary or multiclass, `StratifiedKFold` is used. In all
      other cases, `KFold` is used.
  scoring : string or callable or None, default=None
      A string (see model evaluation documentation) or
      a scorer callable object / function with signature
      `scorer(estimator, X, y)`.
  n_jobs : integer, default=1
      The number of CPUs to use to do the computation. -1 means
      'all CPUs'.
  random_state : int, default=42
      random state for the permutation test.
  
  Attributes
  ----------
  p_value_ : float
      the p-value of the test
  scores_ : list
      contain all scores for all permutations. The fist element is the
      non-permuted score.
  
  See Also
  --------
  PermutationDistance
class_docstr_tok: ["Permutation","test","using","any","scikit-learn","model","for","scoring",".","Perform","a","permutation","test","using","the","cross-validation","score","of","any","scikit-learn","compatible","model",".","Score","is","obtained","with","`","cross_val_score","`","from","scikit-learn",".","The","score","should","be","a","``","higer","is","better","''","metric",".","Parameters","--","--","--","--","--","n_perms",":","int",",","default=100","The","number","of","permutation",".","The","minimum","should","be","20","for","a","resolution","of","0.05","p-value",".","model",":","sklearn","compatible","model",",","default=MDM","(",")","The","model","for","scoring",".","cv",":","int","or","cross-validation","generator","or","an","iterable",",","default=3","Determines","the","cross-validation","splitting","strategy",".","Possible","inputs","for","cv","are",":","-","None",",","to","use","the","default","3-fold","cross","validation",";","-","integer",",","to","specify","the","number","of","folds","in","a","`","(","Stratified",")","KFold","`",";","-","an","object","to","be","used","as","a","cross-validation","generator",";","-","an","iterable","yielding","train",",","test","splits",".","For","integer\/None","inputs",",","if","the","estimator","is","a","classifier","and","`","y","`","is","either","binary","or","multiclass",",","`","StratifiedKFold","`","is","used",".","In","all","other","cases",",","`","KFold","`","is","used",".","scoring",":","string","or","callable","or","None",",","default=None","A","string","(","see","model","evaluation","documentation",")","or","a","scorer","callable","object","\/","function","with","signature","`","scorer","(","estimator",",","X",",","y",")","`",".","n_jobs",":","integer",",","default=1","The","number","of","CPUs","to","use","to","do","the","computation",".","-1","means","'all","CPUs","'",".","random_state",":","int",",","default=42","random","state","for","the","permutation","test",".","Attributes","--","--","--","--","--","p_value_",":","float","the","p-value","of","the","test","scores_",":","list","contain","all","scores","for","all","permutations",".","The","fist","element","is","the","non-permuted","score",".","See","Also","--","--","--","--","PermutationDistance"]
docstr: Init.
docstr_tok: ["Init","."]
code: def __init__(
      self,
      n_perms=100,
      model=MDM(),
      cv=3,
      scoring=None,
      n_jobs=1,
      random_state=42,
  ):
      """Init."""
      self.n_perms = n_perms
      self.model = model
      self.cv = cv
      self.scoring = scoring
      self.n_jobs = n_jobs
      self.random_state = random_state
  
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 to create a new PermutationModel object from inherited base classes: BasePermutation with example: obj = PermutationModel(n_perms, model, cv, scoring, n_jobs, random_state)