|
| context_type |
|
| K |
|
| V |
|
| indices |
|
| corpus |
|
| Z |
|
| alpha |
|
| word_top |
|
| inv_top_sums |
|
| top_doc |
|
| iteration |
|
| log_probs |
|
| seed |
|
An implementation of LDA using collapsed Gibbs sampling.
def vsm.model.ldacgsseq.LdaCgsSeq.__init__ |
( |
|
self, |
|
|
|
corpus = None , |
|
|
|
context_type = None , |
|
|
|
Z = [] , |
|
|
|
K = 20 , |
|
|
|
V = 0 , |
|
|
|
alpha = [] , |
|
|
|
beta = [] , |
|
|
|
seed = None |
|
) |
| |
Initialize LdaCgsSeq.
:param corpus: Source of observed data.
:type corpus: `Corpus`
:param context_type: Name of tokenization stored in `corpus` whose tokens
will be treated as documents.
:type context_type: string, optional
:param K: Number of topics. Default is `20`.
:type K: int, optional
:param alpha: Document priors. Default is a flat prior of 0.01
for all topics.
:type alpha: list, optional
:param beta: Topic priors. Default is 0.01 for all words.
:type beta: list, optional
:param seed: Seed for numpy's RandomState. Default is `None`.
:type seed: int, optional
def vsm.model.ldacgsseq.LdaCgsSeq.load |
( |
|
filename | ) |
|
|
static |
A static method for loading a saved LdaCgsMulti model.
:param filename: Name of a saved model to be loaded.
:type filename: string
:returns: m : LdaCgsMulti object
:See Also: :class:`numpy.load`
def vsm.model.ldacgsseq.LdaCgsSeq.save |
( |
|
self, |
|
|
|
filename |
|
) |
| |
Saves the model in an `.npz` file.
:param filename: Name of a saved model to be loaded.
:type filename: string
:See Also: :class:`numpy.savez`
def vsm.model.ldacgsseq.LdaCgsSeq.train |
( |
|
self, |
|
|
|
n_iterations = 100 , |
|
|
|
verbose = 1 , |
|
|
|
kwargs |
|
) |
| |
Takes an optional argument, `n_iterations` and updates the model
`n_iterations` times.
:param n_iterations: Number of iterations. Default is 100.
:type n_iterations: int, optional
:param verbose: If 1, current number of iterations
are printed out to notify the user. Default is 1.
:type verbose: int, optional
:param kwargs: For compatability with calls to LdaCgsMulti.
:type kwargs: optional
La documentación para esta clase fue generada a partir del siguiente fichero:
- vsm/vsm/model/ldacgsseq.py