predict.textmodel_wordmap {wordmap} | R Documentation |
Predict the most likely class of documents
Description
Predict document class using fitted Wordmap models.
Usage
## S3 method for class 'textmodel_wordmap'
predict(
object,
newdata = NULL,
confidence = FALSE,
rank = 1L,
type = c("top", "all"),
rescale = FALSE,
min_conf = -Inf,
min_n = 0L,
...
)
Arguments
object |
a model fitted by |
newdata |
a dfm on which prediction will be made. |
confidence |
if |
rank |
rank of the class to be predicted. Only used when |
type |
if |
rescale |
if |
min_conf |
returns |
min_n |
set the minimum number of polarity words in documents. |
... |
not used. |
Value
Returns predicted classes as a vector. If confidence = TRUE
,
it returns a list of two vectors:
class |
predicted classes of documents. |
confidence.fit |
the confidence of predictions. |
[Package wordmap version 0.8.0 Index]