class_docstr: Gaussian Naive Bayes (GaussianNB)
  
  Can perform online updates to model parameters via `partial_fit` method.
  For details on algorithm used to update feature means and variance online,
  see Stanford CS tech report STAN-CS-79-773 by Chan, Golub, and LeVeque:
  
      http://i.stanford.edu/pub/cstr/reports/cs/tr/79/773/CS-TR-79-773.pdf
  
  Read more in the :ref:`User Guide <gaussian_naive_bayes>`.
  
  Parameters
  ----------
  priors : array-like, shape (n_classes,)
      Prior probabilities of the classes. If specified the priors are not
      adjusted according to the data.
  
  Attributes
  ----------
  class_prior_ : array, shape (n_classes,)
      probability of each class.
  
  class_count_ : array, shape (n_classes,)
      number of training samples observed in each class.
  
  theta_ : array, shape (n_classes, n_features)
      mean of each feature per class
  
  sigma_ : array, shape (n_classes, n_features)
      variance of each feature per class
  
  Examples
  --------
  >>> import numpy as np
  >>> X = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]])
  >>> Y = np.array([1, 1, 1, 2, 2, 2])
  >>> from sklearn.naive_bayes import GaussianNB
  >>> clf = GaussianNB()
  >>> clf.fit(X, Y)
  GaussianNB(priors=None)
  >>> print(clf.predict([[-0.8, -1]]))
  [1]
  >>> clf_pf = GaussianNB()
  >>> clf_pf.partial_fit(X, Y, np.unique(Y))
  GaussianNB(priors=None)
  >>> print(clf_pf.predict([[-0.8, -1]]))
  [1]
class_docstr_tok: ["Gaussian","Naive","Bayes","(","GaussianNB",")","Can","perform","online","updates","to","model","parameters","via","`","partial_fit","`","method",".","For","details","on","algorithm","used","to","update","feature","means","and","variance","online",",","see","Stanford","CS","tech","report","STAN-CS-79-773","by","Chan",",","Golub",",","and","LeVeque",":","http",":","\/\/i.stanford.edu\/pub\/cstr\/reports\/cs\/tr\/79\/773\/CS-TR-79-773.pdf","Read","more","in","the",":","ref",":","`","User","Guide","<","gaussian_naive_bayes",">","`",".","Parameters","--","--","--","--","--","priors",":","array-like",",","shape","(","n_classes",",",")","Prior","probabilities","of","the","classes",".","If","specified","the","priors","are","not","adjusted","according","to","the","data",".","Attributes","--","--","--","--","--","class_prior_",":","array",",","shape","(","n_classes",",",")","probability","of","each","class",".","class_count_",":","array",",","shape","(","n_classes",",",")","number","of","training","samples","observed","in","each","class",".","theta_",":","array",",","shape","(","n_classes",",","n_features",")","mean","of","each","feature","per","class","sigma_",":","array",",","shape","(","n_classes",",","n_features",")","variance","of","each","feature","per","class","Examples","--","--","--","--",">",">",">","import","numpy","as","np",">",">",">","X","=","np.array","(","[","[","-1",",","-1","]",",","[","-2",",","-1","]",",","[","-3",",","-2","]",",","[","1",",","1","]",",","[","2",",","1","]",",","[","3",",","2","]","]",")",">",">",">","Y","=","np.array","(","[","1",",","1",",","1",",","2",",","2",",","2","]",")",">",">",">","from","sklearn.naive_bayes","import","GaussianNB",">",">",">","clf","=","GaussianNB","(",")",">",">",">","clf.fit","(","X",",","Y",")","GaussianNB","(","priors=None",")",">",">",">","print","(","clf.predict","(","[","[","-0.8",",","-1","]","]",")",")","[","1","]",">",">",">","clf_pf","=","GaussianNB","(",")",">",">",">","clf_pf.partial_fit","(","X",",","Y",",","np.unique","(","Y",")",")","GaussianNB","(","priors=None",")",">",">",">","print","(","clf_pf.predict","(","[","[","-0.8",",","-1","]","]",")",")","[","1","]"]
docstr: Actual implementation of Gaussian NB fitting.
  
  Parameters
  ----------
  X : array-like, shape (n_samples, n_features)
      Training vectors, where n_samples is the number of samples and
      n_features is the number of features.
  
  y : array-like, shape (n_samples,)
      Target values.
  
  classes : array-like, shape (n_classes,), optional (default=None)
      List of all the classes that can possibly appear in the y vector.
  
      Must be provided at the first call to partial_fit, can be omitted
      in subsequent calls.
  
  _refit: bool, optional (default=False)
      If true, act as though this were the first time we called
      _partial_fit (ie, throw away any past fitting and start over).
  
  sample_weight : array-like, shape (n_samples,), optional (default=None)
      Weights applied to individual samples (1. for unweighted).
  
  Returns
  -------
  self : object
      Returns self.
docstr_tok: ["Actual","implementation","of","Gaussian","NB","fitting",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_samples",",","n_features",")","Training","vectors",",","where","n_samples","is","the","number","of","samples","and","n_features","is","the","number","of","features",".","y",":","array-like",",","shape","(","n_samples",",",")","Target","values",".","classes",":","array-like",",","shape","(","n_classes",",",")",",","optional","(","default=None",")","List","of","all","the","classes","that","can","possibly","appear","in","the","y","vector",".","Must","be","provided","at","the","first","call","to","partial_fit",",","can","be","omitted","in","subsequent","calls",".","_refit",":","bool",",","optional","(","default=False",")","If","true",",","act","as","though","this","were","the","first","time","we","called","_partial_fit","(","ie",",","throw","away","any","past","fitting","and","start","over",")",".","sample_weight",":","array-like",",","shape","(","n_samples",",",")",",","optional","(","default=None",")","Weights","applied","to","individual","samples","(","1.","for","unweighted",")",".","Returns","--","--","--","-","self",":","object","Returns","self","."]
code: def _partial_fit(
      self, X, y, classes=None, _refit=False, sample_weight=None
  ):
      """Actual implementation of Gaussian NB fitting.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
          Training vectors, where n_samples is the number of samples and
          n_features is the number of features.
  
      y : array-like, shape (n_samples,)
          Target values.
  
      classes : array-like, shape (n_classes,), optional (default=None)
          List of all the classes that can possibly appear in the y vector.
  
          Must be provided at the first call to partial_fit, can be omitted
          in subsequent calls.
  
      _refit: bool, optional (default=False)
          If true, act as though this were the first time we called
          _partial_fit (ie, throw away any past fitting and start over).
  
      sample_weight : array-like, shape (n_samples,), optional (default=None)
          Weights applied to individual samples (1. for unweighted).
  
      Returns
      -------
      self : object
          Returns self.
      """
      X, y = check_X_y(X, y)
  
      # If the ratio of data variance between dimensions is too small, it
      # will cause numerical errors. To address this, we artificially
      # boost the variance by epsilon, a small fraction of the standard
      # deviation of the largest dimension.
      epsilon = 1e-9 * np.var(X, axis=0).max()
  
      if _refit:
          self.classes_ = None
  
      if _check_partial_fit_first_call(self, classes):
          # This is the first call to partial_fit:
          # initialize various cumulative counters
          n_features = X.shape[1]
          n_classes = len(self.classes_)
          self.theta_ = np.zeros((n_classes, n_features))
          self.sigma_ = np.zeros((n_classes, n_features))
  
          self.class_count_ = np.zeros(n_classes, dtype=np.float64)
  
          # Initialise the class prior
          n_classes = len(self.classes_)
          # Take into account the priors
          if self.priors is not None:
              priors = np.asarray(self.priors)
              # Check that the provide prior match the number of classes
              if len(priors) != n_classes:
                  raise ValueError(
                      "Number of priors must match number of"
                      " classes."
                  )
              # Check that the sum is 1
              if priors.sum() != 1.0:
                  raise ValueError("The sum of the priors should be 1.")
              # Check that the prior are non-negative
              if (priors < 0).any():
                  raise ValueError("Priors must be non-negative.")
              self.class_prior_ = priors
          else:
              # Initialize the priors to zeros for each class
              self.class_prior_ = np.zeros(
                  len(self.classes_), dtype=np.float64
              )
      else:
          if X.shape[1] != self.theta_.shape[1]:
              msg = "Number of features %d does not match previous data %d."
              raise ValueError(msg % (X.shape[1], self.theta_.shape[1]))
          # Put epsilon back in each time
          self.sigma_[:, :] -= epsilon
  
      classes = self.classes_
  
      unique_y = np.unique(y)
      unique_y_in_classes = in1d(unique_y, classes)
  
      if not np.all(unique_y_in_classes):
          raise ValueError(
              "The target label(s) %s in y do not exist in the "
              "initial classes %s"
              % (unique_y[~unique_y_in_classes], classes)
          )
  
      for y_i in unique_y:
          i = classes.searchsorted(y_i)
          X_i = X[y == y_i, :]
  
          if sample_weight is not None:
              sw_i = sample_weight[y == y_i]
              N_i = sw_i.sum()
          else:
              sw_i = None
              N_i = X_i.shape[0]
  
          new_theta, new_sigma = self._update_mean_variance(
              self.class_count_[i],
              self.theta_[i, :],
              self.sigma_[i, :],
              X_i,
              sw_i,
          )
  
          self.theta_[i, :] = new_theta
          self.sigma_[i, :] = new_sigma
          self.class_count_[i] += N_i
  
      self.sigma_[:, :] += epsilon
  
      # Update if only no priors is provided
      if self.priors is None:
          # Empirical prior, with sample_weight taken into account
          self.class_prior_ = (
              self.class_count_ / self.class_count_.sum()
          )
  
      return self
  
imports: from abc import ABCMeta, abstractmethod
  import numpy
  from scipy.sparse import issparse
  from .base import BaseEstimator, ClassifierMixin
  from .preprocessing import binarize
  from .preprocessing import LabelBinarizer
  from .preprocessing import label_binarize
  from .utils import check_X_y, check_array
  from .utils.extmath import safe_sparse_dot, logsumexp
  from .utils.multiclass import _check_partial_fit_first_call
  from .utils.fixes import in1d
  from .utils.validation import check_is_fitted
  from .externals import six
label_desc: Use image node_id 5 for calling the GaussianNB obj's underlying member method code with example usage: obj._partial_fit(X, y, classes, _refit, sample_weight) and returns: self