class_docstr: Abstract base class for naive Bayes on discrete/categorical data
  
  Any estimator based on this class should provide:
  
  __init__
  _joint_log_likelihood(X) as per BaseNB
class_docstr_tok: ["Abstract","base","class","for","naive","Bayes","on","discrete\/categorical","data","Any","estimator","based","on","this","class","should","provide",":","__init__","_joint_log_likelihood","(","X",")","as","per","BaseNB"]
code: def _update_class_log_prior(self, class_prior=None):
      n_classes = len(self.classes_)
      if class_prior is not None:
          if len(class_prior) != n_classes:
              raise ValueError(
                  "Number of priors must match number of" " classes."
              )
          self.class_log_prior_ = np.log(class_prior)
      elif self.fit_prior:
          # empirical prior, with sample_weight taken into account
          self.class_log_prior_ = np.log(self.class_count_) - np.log(
              self.class_count_.sum()
          )
      else:
          self.class_log_prior_ = np.zeros(n_classes) - np.log(
              n_classes
          )
  
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 1 for calling the BaseDiscreteNB obj's underlying member method code with example usage: obj._update_class_log_prior(class_prior) without return types