Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 518 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 518 Bytes

ktLDA

This is an implementation of Latent Dirichlet Allocation for pedagogical purposes. You may want to take a look at the report.

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)