| TEXTMINING | R Documentation |
Apply data mining function on vectorized text
TEXTMINING(corpus, miningmethod, vector = c("docs", "words"), ...)
corpus |
The corpus. |
miningmethod |
The data mining method. |
vector |
Indicates the type of vectorization, documents (TF-IDF) or words (GloVe). |
... |
Parameters passed to the vectorisation and to the data mining method. |
The result of the data mining method.
predict.textmining, textmining-class, vectorize.docs, vectorize.words
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)
data (capitals)
clusters = TEXTMINING (capitals, HCA, vector = "words", k = 5, mincount = 2, ndim = 10, maxiter = 5)
plotclus (clusters$res, capitals, type = "tree", labels = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.