'Calculate the posterior log probability of the samples X'

def _joint_log_likelihood(self, X):

    check_is_fitted(self, 'classes_')
    X = check_array(X, accept_sparse='csr')
    if (self.binarize is not None):
        X = binarize(X, threshold=self.binarize)
    (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_)))
    jll = safe_sparse_dot(X, (self.feature_log_prob_ - neg_prob).T)
    jll += (self.class_log_prior_ + neg_prob.sum(axis=1))
    return jll
