tethne.persistence.hdf5.ldamodel module¶
- class tethne.persistence.hdf5.ldamodel.HDF5LDAModel(theta=None, phi=None, metadata=None, vocabulary=None, datapath=None)[source]¶
Bases: tethne.model.corpus.ldamodel.LDAModel
Provides HDF5 persistence for LDAModel.
- tethne.persistence.hdf5.ldamodel.from_hdf5(HD_or_path)[source]¶
Load a LDAModel from a HDF5LDAModel.
Parameters: HD_or_path : str or HDF5LDAModel
If str, must be a path to a HDF5LDAModel HDF5 repo.
Returns: model : LDAModel
Examples
From a path:
>>> model = from_hdf5('/path/to/my/HDF5LDAModel.h5')
- tethne.persistence.hdf5.ldamodel.to_hdf5(model, datapath=None)[source]¶
Generate a HDF5LDAModel from the current instance.
Parameters: model : LDAModel
datapath : str
(optional) Path to an HDF5 repository. If not provided, generates a temporary path, which can be accessed as the .path attribute.
Returns: hdf5_model : HDF5LDAModel