Methods
__init__([td_matrix, dtype, context_type]) | Initialize Lsa. |
load(f) | Loads LSA model data from a numpy archive file with extension |
save(f) | Saves model data as a numpy archive file with extension npz. |
train([k_factors]) | Trains the model. |
Initialize Lsa.
Parameters: |
|
---|
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.
Parameters: | f (str-like or file-like object) – Designates the file from which to load data. See numpy.load for further details. |
---|---|
Returns: | a saved Lsa model. |
See Also: | numpy.load() |
Saves model data as a numpy archive file with extension npz. The keys for the component matrices are word_matrix, eigenvalues and doc_matrix.
Parameters: | f (str-like or file-like object) – Designates the file to which to save data. See numpy.savez for further details. |
---|---|
See Also: | numpy.savez() |
Trains the model.
Parameters: | k_factors (int, optional) – Default is 300. |
---|