Predict document class using fitted Wordmap models.
# S3 method for textmodel_wordmap
predict(
object,
newdata = NULL,
confidence = FALSE,
rank = 1L,
type = c("top", "all"),
rescale = FALSE,
min_conf = -Inf,
min_n = 0L,
...
)Returns predicted classes as a vector. If confidence = TRUE,
it returns a list of two vectors:
predicted classes of documents.
the confidence of predictions.
a model fitted by textmodel_wordmap().
a dfm on which prediction will be made.
if TRUE, it returns likelihood ratio scores.
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.
returns NA when confidence is lower than this value.
set the minimum number of polarity words in documents.
not used.