class_docstr: Base class for label propagation module.
  
  Parameters
  ----------
  kernel : {'knn', 'rbf'}
      String identifier for kernel function to use.
      Only 'rbf' and 'knn' kernels are currently supported..
  
  gamma : float
      Parameter for rbf kernel
  
  alpha : float
      Clamping factor
  
  max_iter : float
      Change maximum number of iterations allowed
  
  tol : float
      Convergence tolerance: threshold to consider the system at steady
      state
  
  n_neighbors : integer > 0
      Parameter for knn kernel
  
  n_jobs : int, optional (default = 1)
      The number of parallel jobs to run.
      If ``-1``, then the number of jobs is set to the number of CPU cores.
class_docstr_tok: ["Base","class","for","label","propagation","module",".","Parameters","--","--","--","--","--","kernel",":","{","'knn","'",",","'rbf","'","}","String","identifier","for","kernel","function","to","use",".","Only","'rbf","'","and","'knn","'","kernels","are","currently","supported","..","gamma",":","float","Parameter","for","rbf","kernel","alpha",":","float","Clamping","factor","max_iter",":","float","Change","maximum","number","of","iterations","allowed","tol",":","float","Convergence","tolerance",":","threshold","to","consider","the","system","at","steady","state","n_neighbors",":","integer",">","0","Parameter","for","knn","kernel","n_jobs",":","int",",","optional","(","default","=","1",")","The","number","of","parallel","jobs","to","run",".","If","``","-1","``",",","then","the","number","of","jobs","is","set","to","the","number","of","CPU","cores","."]
docstr: Fit a semi-supervised label propagation model based
  
  All the input data is provided matrix X (labeled and unlabeled)
  and corresponding label matrix y with a dedicated marker value for
  unlabeled samples.
  
  Parameters
  ----------
  X : array-like, shape = [n_samples, n_features]
      A {n_samples by n_samples} size matrix will be created from this
  
  y : array_like, shape = [n_samples]
      n_labeled_samples (unlabeled points are marked as -1)
      All unlabeled samples will be transductively assigned labels
  
  Returns
  -------
  self : returns an instance of self.
docstr_tok: ["Fit","a","semi-supervised","label","propagation","model","based","All","the","input","data","is","provided","matrix","X","(","labeled","and","unlabeled",")","and","corresponding","label","matrix","y","with","a","dedicated","marker","value","for","unlabeled","samples",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","=","[","n_samples",",","n_features","]","A","{","n_samples","by","n_samples","}","size","matrix","will","be","created","from","this","y",":","array_like",",","shape","=","[","n_samples","]","n_labeled_samples","(","unlabeled","points","are","marked","as","-1",")","All","unlabeled","samples","will","be","transductively","assigned","labels","Returns","--","--","--","-","self",":","returns","an","instance","of","self","."]
code: def fit(self, X, y):
      """Fit a semi-supervised label propagation model based
  
      All the input data is provided matrix X (labeled and unlabeled)
      and corresponding label matrix y with a dedicated marker value for
      unlabeled samples.
  
      Parameters
      ----------
      X : array-like, shape = [n_samples, n_features]
          A {n_samples by n_samples} size matrix will be created from this
  
      y : array_like, shape = [n_samples]
          n_labeled_samples (unlabeled points are marked as -1)
          All unlabeled samples will be transductively assigned labels
  
      Returns
      -------
      self : returns an instance of self.
      """
      X, y = check_X_y(X, y)
      self.X_ = X
      check_classification_targets(y)
  
      # actual graph construction (implementations should override this)
      graph_matrix = self._build_graph()
  
      # label construction
      # construct a categorical distribution for classification only
      classes = np.unique(y)
      classes = classes[classes != -1]
      self.classes_ = classes
  
      n_samples, n_classes = len(y), len(classes)
  
      y = np.asarray(y)
      unlabeled = y == -1
      clamp_weights = np.ones((n_samples, 1))
      clamp_weights[unlabeled, 0] = self.alpha
  
      # initialize distributions
      self.label_distributions_ = np.zeros((n_samples, n_classes))
      for label in classes:
          self.label_distributions_[y == label, classes == label] = 1
  
      y_static = np.copy(self.label_distributions_)
      if self.alpha > 0.0:
          y_static *= 1 - self.alpha
      y_static[unlabeled] = 0
  
      l_previous = np.zeros((self.X_.shape[0], n_classes))
  
      remaining_iter = self.max_iter
      if sparse.isspmatrix(graph_matrix):
          graph_matrix = graph_matrix.tocsr()
      while (
          _not_converged(
              self.label_distributions_, l_previous, self.tol
          )
          and remaining_iter > 1
      ):
          l_previous = self.label_distributions_
          self.label_distributions_ = safe_sparse_dot(
              graph_matrix, self.label_distributions_
          )
          # clamp
          self.label_distributions_ = (
              np.multiply(clamp_weights, self.label_distributions_)
              + y_static
          )
          remaining_iter -= 1
  
      normalizer = np.sum(self.label_distributions_, axis=1)[
          :, np.newaxis
      ]
      self.label_distributions_ /= normalizer
      # set the transduction item
      transduction = self.classes_[
          np.argmax(self.label_distributions_, axis=1)
      ]
      self.transduction_ = transduction.ravel()
      self.n_iter_ = self.max_iter - remaining_iter
      return self
  
imports: from abc import ABCMeta, abstractmethod
  import numpy
  from scipy import sparse
  from ..base import BaseEstimator, ClassifierMixin
  from ..externals import six
  from ..metrics.pairwise import rbf_kernel
  from ..neighbors.unsupervised import NearestNeighbors
  from ..utils.extmath import safe_sparse_dot
  from ..utils.graph import graph_laplacian
  from ..utils.multiclass import check_classification_targets
  from ..utils.validation import check_X_y, check_is_fitted, check_array
label_desc: Use image node_id 6 for calling the BaseLabelPropagation obj's underlying member method code with example usage: obj.fit(X, y) and returns: self