code: def _joint_log_likelihood(self, X):
          
          check_is_fitted(self, "classes_")
  
          X = check_array(X, accept_sparse='csr')
          X_bin = self._transform_data(X)
  
          n_classes, n_features = self.feature_log_prob_.shape
          n_samples, n_features_X = X_bin.shape
  
          if n_features_X != n_features:
              raise ValueError(
                  "Expected input with %d features, got %d instead" %
                  (n_features, n_features_X))
  
          # see chapter 4.1 of http://www.cs.columbia.edu/~mcollins/em.pdf
          # implementation as in Formula 4.
  
          jll = safe_sparse_dot(X_bin, self.feature_log_prob_.T)
          jll += self.class_log_prior_
  
          return jll
docs: Calculate the posterior log probability of the samples X