
Uses a trained model from the train_models
function to classify new data.
classify_models(container, models, ...)
Class of type matrix_container-class
generated by the create_container
function.
List of models to be used for classification generated by train_models
.
Other parameters to be passed on to classify_model
.
Use the list returned by train_models
to use multiple models for classification.
# NOT RUN {
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)
# }
Run the code above in your browser using DataLab