#NEWLINE# def _update_class_log_prior( self , class_prior = None ) : #NEWLINE# #INDENT# n_classes = len ( self . classes_ ) #NEWLINE# if ( class_prior is not None ) : #NEWLINE# #INDENT# if ( len ( class_prior ) != n_classes ) : #NEWLINE# #INDENT# raise ValueError ( 'Number of priors must match number of classes.' ) #NEWLINE# #UNINDENT# self . class_log_prior_ = np . log ( class_prior ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if self . fit_prior : #NEWLINE# #INDENT# self . class_log_prior_ = ( np . log ( self . class_count_ ) - np . log ( self . class_count_ . sum ( ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . class_log_prior_ = ( np . zeros ( n_classes ) - np . log ( n_classes ) )