Skip to content

Commit 0bee058

Browse files
chyikweijnothman
authored andcommitted
DOC update LatentDirichletAllocation components_ description (scikit-learn#8805)
1 parent 9e49be2 commit 0bee058

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sklearn/decomposition/online_lda.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,13 @@ class LatentDirichletAllocation(BaseEstimator, TransformerMixin):
228228
Attributes
229229
----------
230230
components_ : array, [n_topics, n_features]
231-
Topic word distribution. ``components_[i, j]`` represents word j in
232-
topic `i`.
231+
Variational parameters for topic word distribution. Since the complete
232+
conditional for topic word distribution is a Dirichlet,
233+
``components_[i, j]`` can be viewed as pseudocount that represents the
234+
number of times word `j` was assigned to topic `i`.
235+
It can also be viewed as distribution over the words for each topic
236+
after normalization:
237+
``model.components_ / model.components_.sum(axis=1)[:, np.newaxis]``.
233238
234239
n_batch_iter_ : int
235240
Number of iterations of the EM step.

0 commit comments

Comments
 (0)