Learn R Programming

textir (version 1.6-1)

predict.topics: topic predict

Description

Predict function for Topic Models

Usage

## S3 method for class 'topics':
predict( object, newcounts, grp=NULL, ... )

Arguments

object
An output object from the topics function.
newcounts
An nrow(object$theta)-column matrix of multinomial phrase/category counts for new documents/observations. Can be either a simple matrix or a simple_triplet_matrix.
grp
If !object$admix, this is an optional group membership vector.
...
Additional arguments to the undocumented internal tpx* functions.

Value

  • The output is an nrow(newcounts) by object$K matrix of document topic weights, or a membership vector if !object$admix.

Details

Under the default mixed-membership topic model, this function uses sequential quadratic programming to fit topic weights $\Omega$ for new documents. Estimates for each new $\omega_i$ are, conditional on object$theta, MAP in the (K-1)-dimensional logit transformed parameter space. If !object$admix, this instead returns the highest posterior probability topic for each document.

References

Taddy (2011), Estimation of Topic Models.

See Also

topics, plot.topics, summary.topics, we8there, congress109, wsjibm