Skip to main content

An implementation of latent Dirichlet allocation

Project description


This is an implementation of Latent Dirichlet Allocation for pedagogical purposes.


  • numpy
  • tqdm


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)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for ktLDA, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size ktLDA-0.0.6-cp37-cp37m-macosx_10_14_x86_64.whl (156.8 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size ktLDA-0.0.6.tar.gz (108.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page