train_models {RTextTools} | R Documentation |
makes a model object using the specified algorithms.
Description
Creates a trained model using the specified algorithms.
Usage
train_models(container, algorithms, ...)
Arguments
container |
Class of type |
algorithms |
List of algorithms as a character vector (e.g. |
... |
Other parameters to be passed on to |
Details
Calls the train_model
function for each algorithm you list.
Value
Returns a list
of trained models that can be subsequently used in classify_models
to classify new data.
Author(s)
Wouter Van Atteveldt <wouter@vanatteveldt.com>
Examples
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"))
[Package RTextTools version 1.4.3 Index]