parameters: (self, X)
return_statement: return jll
docstring: Calculate the posterior log probability of the samples X
docstring_summary: Calculate the posterior log probability of the samples X
docstring_tokens: Calculate the posterior log probability of the samples X
function: def _joint_log_likelihood(self, X):
          """Calculate the posterior log probability of the samples X"""
          n_classes, n_features = self.feature_log_prob_.shape
          n_samples, n_features_X = X.shape
  
          if n_features_X != n_features:
              raise ValueError("Expected input with %d features, got %d instead"
                               % (n_features, n_features_X))
  
          neg_prob = np.log(1 - np.exp(self.feature_log_prob_))
          # Compute  neg_prob · (1 - X).T  as  ∑neg_prob - X · neg_prob
          jll = safe_sparse_dot(X, (self.feature_log_prob_ - neg_prob).T)
          jll += self.class_log_prior_ + neg_prob.sum(axis=1)
  
          return jll
function_tokens: def _joint_log_likelihood ( self , X ) : n_classes , n_features = self . feature_log_prob_ . shape n_samples , n_features_X = X . shape if n_features_X != n_features : raise ValueError ( "Expected input with %d features, got %d instead" % ( n_features , n_features_X ) ) neg_prob = np . log ( 1 - np . exp ( self . feature_log_prob_ ) ) # Compute  neg_prob · (1 - X).T  as  ∑neg_prob - X · neg_prob jll = safe_sparse_dot ( X , ( self . feature_log_prob_ - neg_prob ) . T ) jll += self . class_log_prior_ + neg_prob . sum ( axis = 1 ) return jll