'Transform data X according to fitted model.
Parameters
X : array-like or sparse matrix, shape=(n_samples, n_features)
Document word matrix.
Returns
doc_topic_distr : shape=(n_samples, n_components)
Document topic distribution for X.'

def _unnormalized_transform(self, X):

    if (not hasattr(self, 'components_')):
        raise NotFittedError("no    'components_'    attribute    in    model.    Please    fit    model    first.")
    X = self._check_non_neg_array(X, 'LatentDirichletAllocation.transform')
    (n_samples, n_features) = X.shape
    if (n_features != self.components_.shape[1]):
        raise ValueError(('The    provided    data    has    %d    dimensions    while    the    model    was    trained    with    feature    size    %d.' % (n_features, self.components_.shape[1])))
    (doc_topic_distr, _) = self._e_step(X, cal_sstats=False, random_init=False)
    return doc_topic_distr
