Learn R Programming

RTextTools (version 1.3.8)

create_scoreSummary: creates a summary with the best label for each document.

Description

Creates a summary with the best label for each document, determined by highest algorithm certainty, and highest consensus (i.e. most number of algorithms agreed).

Usage

create_scoreSummary(corpus, classification_results)

Arguments

corpus
Class of type matrix_container-class generated by the create_corpus function.
classification_results
A cbind() of result objects returned by classify_model, or the object returned by classify_models.

Examples

Run this code
library(RTextTools)
data <- read_data(system.file("data/NYTimes.csv.gz",package="RTextTools"),type="csv")
data <- data[sample(1:3100,size=100,replace=FALSE),]
matrix <- create_matrix(cbind(data$Title,data$Subject), language="english", 
removeNumbers=TRUE, stemWords=FALSE, weighting=weightTfIdf)
corpus <- create_corpus(matrix,data$Topic.Code,trainSize=1:75, testSize=76:100, 
virgin=FALSE)
models <- train_models(corpus, algorithms=c("MAXENT","SVM"))
results <- classify_models(corpus, models)
score_summary <- create_scoreSummary(corpus, results)

Run the code above in your browser using DataLab