Predict document class using trained a Newsmap model
# S3 method for textmodel_newsmap
predict(
object,
newdata = NULL,
confidence = FALSE,
rank = 1L,
type = c("top", "all"),
rescale = FALSE,
min_conf = -Inf,
min_n = 0L,
...
)a fitted Newsmap textmodel.
dfm on which prediction should be made.
if TRUE, it returns likelihood ratio score.
rank of the class to be predicted. Only used when type = "top".
if top, returns the most likely class specified by rank;
otherwise return a matrix of likelihood ratio scores for all possible
classes.
if TRUE, likelihood ratio scores are normalized using scale(). This affects
both types of results.
return NA when confidence is lower than this value.
set the minimum number of polarity words in documents.
not used.