Skip to content

Commit

Permalink
LdaModel documentation update -remove claim that it accepts CSC matri…
Browse files Browse the repository at this point in the history
…x as input (#2832)

* Update LDA model documentation to remove the claim that LDA accepts CSC matrices as an input

* Update CHANGELOG.md

Co-authored-by: Michael Penkov <m@penkov.dev>
  • Loading branch information
FyzHsn and mpenkov authored May 14, 2020
1 parent ceecef3 commit 69732eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ Changes
* No more wheels for x32 platforms (if you need x32 binaries, please build them yourself).
(__[menshikh-iv](https://github.com/menshikh-iv)__, [#6](https://github.com/RaRe-Technologies/gensim-wheels/pull/6))

### :books: Tutorial and doc improvements

* Clear up LdaModel documentation - remove claim that it accepts CSC matrix as input (PR [#2832](https://github.com/RaRe-Technologies/gensim/pull/2832), [@FyzHsn](https://github.com/FyzHsn))

## :warning: 3.8.x will be the last gensim version to support Py2.7. Starting with 4.0.0, gensim will only support Py3.5 and above

## 3.8.3, 2020-05-03
Expand Down
14 changes: 8 additions & 6 deletions gensim/models/ldamodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,10 @@ def __init__(self, corpus=None, num_topics=100, id2word=None,
Parameters
----------
corpus : {iterable of list of (int, float), scipy.sparse.csc}, optional
corpus : iterable of list of (int, float), optional
Stream of document vectors or sparse matrix of shape (`num_documents`, `num_terms`).
If you have a CSC in-memory matrix, you can convert it to a
streamed corpus with the help of gensim.matutils.Sparse2Corpus.
If not given, the model is left untrained (presumably because you want to call
:meth:`~gensim.models.ldamodel.LdaModel.update` manually).
num_topics : int, optional
Expand Down Expand Up @@ -626,7 +628,7 @@ def inference(self, chunk, collect_sstats=False):
Parameters
----------
chunk : {list of list of (int, float), scipy.sparse.csc}
chunk : list of list of (int, float)
The corpus chunk on which the inference step will be performed.
collect_sstats : bool, optional
If set to True, also collect (and return) sufficient statistics needed to update the model's topic-word
Expand Down Expand Up @@ -725,7 +727,7 @@ def do_estep(self, chunk, state=None):
Parameters
----------
chunk : {list of list of (int, float), scipy.sparse.csc}
chunk : list of list of (int, float)
The corpus chunk on which the inference step will be performed.
state : :class:`~gensim.models.ldamodel.LdaState`, optional
The state to be updated with the newly accumulated sufficient statistics. If none, the models
Expand Down Expand Up @@ -803,7 +805,7 @@ def log_perplexity(self, chunk, total_docs=None):
Parameters
----------
chunk : {list of list of (int, float), scipy.sparse.csc}
chunk : list of list of (int, float)
The corpus chunk on which the inference step will be performed.
total_docs : int, optional
Number of docs used for evaluation of the perplexity.
Expand Down Expand Up @@ -845,7 +847,7 @@ def update(self, corpus, chunksize=None, decay=None, offset=None,
Parameters
----------
corpus : {iterable of list of (int, float), scipy.sparse.csc}, optional
corpus : iterable of list of (int, float), optional
Stream of document vectors or sparse matrix of shape (`num_documents`, `num_terms`) used to update the
model.
chunksize : int, optional
Expand Down Expand Up @@ -1060,7 +1062,7 @@ def bound(self, corpus, gamma=None, subsample_ratio=1.0):
Parameters
----------
corpus : {iterable of list of (int, float), scipy.sparse.csc}, optional
corpus : iterable of list of (int, float), optional
Stream of document vectors or sparse matrix of shape (`num_documents`, `num_terms`) used to estimate the
variational bounds.
gamma : numpy.ndarray, optional
Expand Down

0 comments on commit 69732eb

Please sign in to comment.