Learn R Programming

fdm2id (version 0.9.6)

predict.textmining: Model predictions

Description

This function predicts values based upon a model trained for text mining.

Usage

# S3 method for textmining
predict(object, test, fuzzy = FALSE, ...)

Value

A vector of predicted values (factor).

Arguments

object

The classification model (of class textmining-class, created by TEXTMINING.

test

The test set (a data.frame)

fuzzy

A boolean indicating whether fuzzy classification is used or not.

...

Other parameters.

See Also

TEXTMINING, textmining-class

Examples

Run this code
if (FALSE) {
require (text2vec)
data ("movie_review")
d = movie_review [, 2:3]
d [, 1] = factor (d [, 1])
d = splitdata (d, 1)
model = TEXTMINING (d$train.x, NB, labels = d$train.y, mincount = 50)
pred = predict (model, d$test.x)
evaluation (pred, d$test.y)
}

Run the code above in your browser using DataLab