Created
September 1, 2016 00:27
-
-
Save aneesha/accd591cf24cc7237ed623a102729ea8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.decomposition import NMF, LatentDirichletAllocation | |
no_topics = 20 | |
# Run NMF | |
nmf = NMF(n_components=no_topics, random_state=1, alpha=.1, l1_ratio=.5, init='nndsvd').fit(tfidf) | |
# Run LDA | |
lda = LatentDirichletAllocation(n_topics=no_topics, max_iter=5, learning_method='online', learning_offset=50.,random_state=0).fit(tf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment