Last active
April 29, 2017 20:36
-
-
Save myui/5a05bc8e2c905f31f3d6e496a06282eb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-- fitting | |
select | |
label, word, avg(lambda) as lambda | |
from ( | |
select | |
train_lda(feature, "-topic 2 -iter 20") | |
as (label, word, lambda) | |
from | |
data | |
) t1 | |
group by label, word; | |
-- prediction | |
select | |
t.docid, | |
lda_predict( | |
t.word, t.value, m.label, m.lambda, | |
"-topic 2" | |
) as probabilities | |
from | |
test t | |
JOIN lda_model m ON (t.word = m.word) | |
group by | |
t.docid; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment