An implementation of latent Dirichlet allocation
Project description
ktLDA
This is an implementation of Latent Dirichlet Allocation for pedagogical purposes.
Dependencies
- numpy
- tqdm
Examples
from ktlda import KtLDA
import pickle
with open('ourdata-cleaned.pickle', 'rb') as f:
comp, rec = pickle.load(f)
X = comp + rec
Y = [0] * len(comp) + [1] * len(rec)
lda = KtLDA(n_components=2, alpha=0.5, beta=0.5, iterations=10, max_vocab=5000, random_state=663)
lda.fit(X)
print(lda.doc_topic_dist)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ktLDA-0.0.6.tar.gz
(108.7 kB
view hashes)
Built Distribution
Close
Hashes for ktLDA-0.0.6-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88fe720695d10dc32370c8fcb724872fcb5806ad51badde08d0cf455ae43a564 |
|
MD5 | 55c31781aa90edc8ec51c2b7b1ce1cd3 |
|
BLAKE2b-256 | f6c1eb3b5fbeb447bf6614fe4e84acf01a83feba33cc61a7487fb633b22fc121 |