predict.textmining: Model predictions

Description Usage Arguments Value See Also Examples

Description

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

Usage

1
2
## S3 method for class 'textmining'
predict(object, test, fuzzy = FALSE, ...)

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.

Value

A vector of predicted values (factor).

See Also

TEXTMINING, textmining-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
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)

## End(Not run)

fdm2id documentation built on Oct. 29, 2021, 5:07 p.m.