Description Usage Arguments Details Author(s) Examples
View source: R/classify_models.R
Uses a trained model from the train_models
function to classify new data.
1 | classify_models(container, models, ...)
|
container |
Class of type |
models |
List of models to be used for classification generated by |
... |
Other parameters to be passed on to |
Use the list returned by train_models
to use multiple models for classification.
Wouter Van Atteveldt <wouter@vanatteveldt.com>, Timothy P. Jurka <tpjurka@ucdavis.edu>
1 2 3 4 5 6 7 8 9 | library(RTextTools)
data(NYTimes)
data <- NYTimes[sample(1:3100,size=100,replace=FALSE),]
matrix <- create_matrix(cbind(data["Title"],data["Subject"]), language="english",
removeNumbers=TRUE, stemWords=FALSE, weighting=tm::weightTfIdf)
container <- create_container(matrix,data$Topic.Code,trainSize=1:75, testSize=76:100,
virgin=FALSE)
models <- train_models(container, algorithms=c("RF","SVM"))
results <- classify_models(container, models)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.