Learn R Programming

RTextTools (version 1.3.8)

analytics_container_virgin-class: an S4 class containing the analytics for a classified set of documents.

Description

An S4 class containing the analytics for a classified set of documents. This includes a label summary and a document summary. This class is returned if virgin=TRUE in create_corpus.

Arguments

Objects from the Class

Objects could in principle be created by calls of the form new("analytics_container", ...). The preferred form is to have them created via a call to create_analytics.

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=TRUE)
models <- train_models(corpus, algorithms=c("MAXENT","SVM"))
results <- classify_models(corpus, models)
analytics <- create_analytics(corpus, results)

analytics@label_summary
analytics@document_summary

Run the code above in your browser using DataLab