Learn R Programming

RTextTools (version 1.3.8)

wizard_train_classify: a simplified function for training and classifying data.

Description

A simple interface for training and classifying data using the internal train_model and classify_model commands, and returning a results data.frame ready for use in create_analytics.

Usage

wizard_train_classify(corpus, algorithms, ...)

Arguments

corpus
Class of type matrix_container-class generated by the create_corpus function.
algorithms
List of algorithms as a character vector (e.g. c("SVM","MAXENT")).
...
Other parameters to be passed on to train_model.

Value

  • A data.frame containing the results of the classification. Pass into create_analytics to generate detailed analytics.

Examples

Run this code
library(RTextTools)
corpus <- wizard_read_data(system.file("data/NYTimes.csv.gz",package="RTextTools"), 
textColumns=c("Title","Subject"), codeColumn="Topic.Code", trainSize=75, 
testSize=25, virgin=FALSE)
results <- wizard_train_classify(corpus, c("SVM", "MAXENT"))

Run the code above in your browser using DataLab