| predict.textmining | R Documentation |
This function predicts values based upon a model trained for text mining.
## S3 method for class 'textmining'
predict(object, test, fuzzy = FALSE, ...)
object |
The classification model (of class |
test |
The test set (a |
fuzzy |
A boolean indicating whether fuzzy classification is used or not. |
... |
Other parameters. |
A vector of predicted values (factor).
TEXTMINING, textmining-class
require (text2vec)
# A small subset of movie_review is used here so this example runs quickly.
data ("movie_review")
d = movie_review [1:300, 2:3]
d [, 1] = factor (d [, 1])
d = splitdata (d, 1)
model = TEXTMINING (d$train.x, NB, labels = d$train.y, mincount = 10)
pred = predict (model, d$test.x)
evaluation (pred, d$test.y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.