class_docstr: Implement search_light analysis using an arbitrary type of classifier.
  
  Parameters
  ----------
  mask_img : Niimg-like object
      See :ref:`extracting_data`.
      Boolean image giving location of voxels containing usable signals.
  
  process_mask_img : Niimg-like object, optional
      See :ref:`extracting_data`.
      Boolean image giving voxels on which searchlight should be
      computed.
  
  radius : float, default=2.
      radius of the searchlight ball, in millimeters.
  
  estimator : 'svr', 'svc', or an estimator object implementing 'fit'
      The object to use to fit the data
  %(n_jobs)s
  scoring : string or callable, optional
      The scoring strategy to use. See the scikit-learn documentation
      If callable, takes as arguments the fitted estimator, the
      test data (X_test) and the test target (y_test) if y is
      not None.
  
  cv : cross-validation generator, optional
      A cross-validation generator. If None, a 3-fold cross
      validation is used or 3-fold stratified cross-validation
      when y is supplied.
  %(verbose0)s
  
  Notes
  -----
  The searchlight [Kriegeskorte 06] is a widely used approach for the
  study of the fine-grained patterns of information in fMRI analysis.
  Its principle is relatively simple: a small group of neighboring
  features is extracted from the data, and the prediction function is
  instantiated on these features only. The resulting prediction
  accuracy is thus associated with all the features within the group,
  or only with the feature on the center. This yields a map of local
  fine-grained information, that can be used for assessing hypothesis
  on the local spatial layout of the neural code under investigation.
  
  Nikolaus Kriegeskorte, Rainer Goebel & Peter Bandettini.
  Information-based functional brain mapping.
  Proceedings of the National Academy of Sciences
  of the United States of America,
  vol. 103, no. 10, pages 3863-3868, March 2006
class_docstr_tok: ["Implement","search_light","analysis","using","an","arbitrary","type","of","classifier",".","Parameters","--","--","--","--","--","mask_img",":","Niimg-like","object","See",":","ref",":","`","extracting_data","`",".","Boolean","image","giving","location","of","voxels","containing","usable","signals",".","process_mask_img",":","Niimg-like","object",",","optional","See",":","ref",":","`","extracting_data","`",".","Boolean","image","giving","voxels","on","which","searchlight","should","be","computed",".","radius",":","float",",","default=2",".","radius","of","the","searchlight","ball",",","in","millimeters",".","estimator",":","'svr","'",",","'svc","'",",","or","an","estimator","object","implementing","'fit'","The","object","to","use","to","fit","the","data","%","(","n_jobs",")","s","scoring",":","string","or","callable",",","optional","The","scoring","strategy","to","use",".","See","the","scikit-learn","documentation","If","callable",",","takes","as","arguments","the","fitted","estimator",",","the","test","data","(","X_test",")","and","the","test","target","(","y_test",")","if","y","is","not","None",".","cv",":","cross-validation","generator",",","optional","A","cross-validation","generator",".","If","None",",","a","3-fold","cross","validation","is","used","or","3-fold","stratified","cross-validation","when","y","is","supplied",".","%","(","verbose0",")","s","Notes","--","--","-","The","searchlight","[","Kriegeskorte","06","]","is","a","widely","used","approach","for","the","study","of","the","fine-grained","patterns","of","information","in","fMRI","analysis",".","Its","principle","is","relatively","simple",":","a","small","group","of","neighboring","features","is","extracted","from","the","data",",","and","the","prediction","function","is","instantiated","on","these","features","only",".","The","resulting","prediction","accuracy","is","thus","associated","with","all","the","features","within","the","group",",","or","only","with","the","feature","on","the","center",".","This","yields","a","map","of","local","fine-grained","information",",","that","can","be","used","for","assessing","hypothesis","on","the","local","spatial","layout","of","the","neural","code","under","investigation",".","Nikolaus","Kriegeskorte",",","Rainer","Goebel","&","Peter","Bandettini",".","Information-based","functional","brain","mapping",".","Proceedings","of","the","National","Academy","of","Sciences","of","the","United","States","of","America",",","vol",".","103",",","no",".","10",",","pages","3863-3868",",","March","2006"]
docstr: Fit the searchlight.
  
  Parameters
  ----------
  imgs : Niimg-like object
      See :ref:`extracting_data`.
      4D image.
  
  y : 1D array-like
      Target variable to predict. Must have exactly as many elements as
      3D images in img.
  
  groups : array-like, optional
      group label for each sample for cross validation. Must have
      exactly as many elements as 3D images in img. default None
      NOTE: will have no effect for scikit learn < 0.18
docstr_tok: ["Fit","the","searchlight",".","Parameters","--","--","--","--","--","imgs",":","Niimg-like","object","See",":","ref",":","`","extracting_data","`",".","4D","image",".","y",":","1D","array-like","Target","variable","to","predict",".","Must","have","exactly","as","many","elements","as","3D","images","in","img",".","groups",":","array-like",",","optional","group","label","for","each","sample","for","cross","validation",".","Must","have","exactly","as","many","elements","as","3D","images","in","img",".","default","None","NOTE",":","will","have","no","effect","for","scikit","learn","<","0.18"]
code: def fit(self, imgs, y, groups=None):
      """Fit the searchlight.
  
      Parameters
      ----------
      imgs : Niimg-like object
          See :ref:`extracting_data`.
          4D image.
  
      y : 1D array-like
          Target variable to predict. Must have exactly as many elements as
          3D images in img.
  
      groups : array-like, optional
          group label for each sample for cross validation. Must have
          exactly as many elements as 3D images in img. default None
          NOTE: will have no effect for scikit learn < 0.18
  
      """
      # check if image is 4D
      imgs = check_niimg_4d(imgs)
  
      # Get the seeds
      process_mask_img = self.process_mask_img
      if self.process_mask_img is None:
          process_mask_img = self.mask_img
  
      # Compute world coordinates of the seeds
      process_mask, process_mask_affine = masking.load_mask_img(
          process_mask_img
      )
      process_mask_coords = np.where(process_mask != 0)
      process_mask_coords = coord_transform(
          process_mask_coords[0],
          process_mask_coords[1],
          process_mask_coords[2],
          process_mask_affine,
      )
      process_mask_coords = np.asarray(process_mask_coords).T
  
      X, A = _apply_mask_and_get_affinity(
          process_mask_coords,
          imgs,
          self.radius,
          True,
          mask_img=self.mask_img,
      )
  
      estimator = self.estimator
      if estimator == "svc":
          estimator = ESTIMATOR_CATALOG[estimator](dual=True)
      elif isinstance(estimator, str):
          estimator = ESTIMATOR_CATALOG[estimator]()
  
      scores = search_light(
          X,
          y,
          estimator,
          A,
          groups,
          self.scoring,
          self.cv,
          self.n_jobs,
          self.verbose,
      )
      scores_3D = np.zeros(process_mask.shape)
      scores_3D[process_mask] = scores
      self.scores_ = scores_3D
      return self
  
imports: import sys
  import time
  import warnings
  import numpy
  from joblib import Parallel, cpu_count, delayed
  from sklearn import svm
  from sklearn.base import BaseEstimator
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.model_selection import cross_val_score
  from nilearn.maskers.nifti_spheres_masker import _apply_mask_and_get_affinity
  from ..None import masking
  from .._utils import check_niimg_4d, fill_doc
  from ..image.resampling import coord_transform
label_desc: Use image node_id 2 for calling the SearchLight obj's underlying member method code with example usage: obj.fit(imgs, y, groups) and returns: self