Learn R Programming

textir (version 1.5.2)

predict.topics: topic predict

Description

Predict function for Topic Models

Usage

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

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.
...
Additional arguments to the undocumented internal tpx* functions.

Value

  • The output is an nrow(newcounts) by object$K matrix of document topic weights.

Details

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.

References

Taddy (2011), Estimation of Topic Models.

See Also

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