Note that there are some explanatory texts on larger screens.

plurals
  1. POPredicting LDA topics for new data
    primarykey
    data
    text
    <p>It looks like this question has may have been asked a few times before (<a href="https://stackoverflow.com/questions/10483349/topic-modeling-how-do-i-use-my-fitted-lda-model-to-predict-new-topics-for-a-new">here</a> <a href="https://stackoverflow.com/questions/14875493/lda-with-topicmodels-how-can-i-see-which-topics-different-documents-belong-to?rq=1">and here</a>), but it has yet to be answered. I'm hoping this is due to the previous ambiguity of the question(s) asked, as indicated by comments. I apologize if I am breaking protocol by asking a simliar question again, I just assumed that those questions would not be seeing any new answers.</p> <p>Anyway, I am new to Latent Dirichlet Allocation and am exploring its use as a means of dimension reduction for textual data. Ultimately I would like extract a smaller set of topics from a very large bag of words and build a classification model using those topics as a few variables in the model. I've had success in running LDA on a training set, but the problem I am having is being able to predict which of those same topics appear in some other test set of data. I am using R's topicmodels package right now, but if there is another way to this using some other package I am open to that as well.</p> <p>Here is an example of what I am trying to do:</p> <pre><code>library(topicmodels) data(AssociatedPress) train &lt;- AssociatedPress[1:100] test &lt;- AssociatedPress[101:150] train.lda &lt;- LDA(train,5) topics(train.lda) #how can I predict the most likely topic(s) from "train.lda" for each document in "test"? </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload