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 details)
Built Distribution
File details
Details for the file ktLDA-0.0.6.tar.gz
.
File metadata
- Download URL: ktLDA-0.0.6.tar.gz
- Upload date:
- Size: 108.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6aa8ad7e0b53f9801a7819401524d9871fcffed433ff7174202b4767939d2845
|
|
MD5 |
cbb4c188168a5ad40e676093438d0093
|
|
BLAKE2b-256 |
6e57d2b92f39223d8aaa0ea8adbaa477d6278ce1ab003c2fc406b4205f297a19
|
File details
Details for the file ktLDA-0.0.6-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: ktLDA-0.0.6-cp37-cp37m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 156.8 kB
- Tags: CPython 3.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
88fe720695d10dc32370c8fcb724872fcb5806ad51badde08d0cf455ae43a564
|
|
MD5 |
55c31781aa90edc8ec51c2b7b1ce1cd3
|
|
BLAKE2b-256 |
f6c1eb3b5fbeb447bf6614fe4e84acf01a83feba33cc61a7487fb633b22fc121
|