|
| word_matrix |
|
| doc_matrix |
|
| eigenvalues |
|
| context_type |
|
| corpus |
|
| td_matrix |
|
def vsm.model.lsa.Lsa.__init__ |
( |
|
self, |
|
|
|
corpus = None , |
|
|
|
context_type = None , |
|
|
|
td_matrix = None |
|
) |
| |
Initialize Lsa.
:param corpus: A Corpus object containing the training data.
:type corpus: Corpus, optional
:param context_type: Name of tokenization whose tokens will be
treated as documents. Default is `None`.
:type context_type: string, optional
:param td_matrix: Term-Document matrix. Default is `None`.
:type td_matrix: np.array, optional
def vsm.model.lsa.Lsa.from_tf |
( |
|
tf_model | ) |
|
|
static |
Takes a `Tf` model object and generates a `TfIdf` model.
def vsm.model.lsa.Lsa.from_tfidf |
( |
|
tfidf_model | ) |
|
|
static |
Takes a `Tf` model object and generates a `TfIdf` model.
def vsm.model.lsa.Lsa.load |
( |
|
f | ) |
|
|
static |
Loads LSA model data from a numpy archive file with extension
`npz`. The expected keys for the component matrices are
`word_matrix`, `eigenvalues` and `doc_matrix`.
:param f: Designates the file from which to load data. See
`numpy.load` for further details.
:type f: str-like or file-like object
:returns: a saved Lsa model.
:See Also: :meth:`numpy.load`
def vsm.model.lsa.Lsa.save |
( |
|
self, |
|
|
|
f |
|
) |
| |
Saves model data as a numpy archive file with extension `npz`.
The keys for the component matrices are `word_matrix`,
`eigenvalues` and `doc_matrix`.
:param f: Designates the file to which to save data. See
`numpy.savez` for further details.
:type f: str-like or file-like object
:See Also: :meth:`numpy.savez`
def vsm.model.lsa.Lsa.train |
( |
|
self, |
|
|
|
k_factors = 300 |
|
) |
| |
Trains the model.
:param k_factors: Default is 300.
:type k_factors: int, optional
La documentación para esta clase fue generada a partir del siguiente fichero: