mallet.doc.topics: Retrieve a matrix of topic weights for every document

Description Usage Arguments


This function returns a matrix with one row for every document and one column for every topic.


mallet.doc.topics(topic.model, normalized, smoothed)



The model returned by MalletLDA


If true, normalize the rows so that each document sums to one. If false, values will be integers (possibly plus the smoothing constant) representing the actual number of words of each topic in the documents.


If true, add the smoothing parameter for the model (initial value specified as alpha.sum in MalletLDA). If false, many values will be zero.

Search within the mallet package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.