Description Usage Arguments Details Value Author(s) Examples
View source: R/classify_model.R
Uses a trained model from the train_model
function to classify new data.
1 | classify_model(container, model, s=0.01, ...)
|
container |
Class of type |
model |
Slot for trained SVM, SLDA, boosting, bagging, RandomForests, glmnet, decision tree, neural network, or maximum entropy model generated by |
s |
Penalty parameter lambda for glmnet classification. |
... |
Additional parameters to be passed into the |
Only one model may be passed in at a time for classification. See train_models
and classify_models
to train and classify using multiple algorithms.
Returns a data.frame
of predicted codes and probabilities for the specified algorithm.
Loren Collingwood <loren.collingwood@gmail.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)
svm_model <- train_model(container,"SVM")
svm_results <- classify_model(container,svm_model)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.