R: an S4 class containing the analytics for a classified set of...
analytics-class
R Documentation
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, document summary, ensemble summary, and algorithm summary. This class is returned if virgin=FALSE in create_container.
Objects from the Class
Objects could in principle be created by calls of the
form new("analytics", ...).
The preferred form is to have them created via a call to
create_analytics.
Slots
label_summary
Object of class "data.frame":
stores the analytics for each label, including the percent coded accurately and how much overcoding occurred
document_summary
Object of class "data.frame":
stores the analytics for each document, including all available raw data associated with the learning process
algorithm_summary
Object of class "data.frame":
stores precision, recall, and F-score statistics for each algorithm, broken down by label
ensemble_summary
Object of class "matrix":
stores the accuracy and coverage for an n-algorithm ensemble scoring
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(RTextTools)
Loading required package: SparseM
Attaching package: 'SparseM'
The following object is masked from 'package:base':
backsolve
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/RTextTools/analytics-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: analytics-class
> ### Title: an S4 class containing the analytics for a classified set of
> ### documents.
> ### Aliases: analytics-class
> ### Keywords: classes
>
> ### ** 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("MAXENT","SVM"))
> results <- classify_models(container, models)
> analytics <- create_analytics(container, results)
>
> summary(analytics)
ENSEMBLE SUMMARY
n-ENSEMBLE COVERAGE n-ENSEMBLE RECALL
n >= 1 1.0 0.32
n >= 2 0.2 0.60
ALGORITHM PERFORMANCE
SVM_PRECISION SVM_RECALL SVM_FSCORE
0.05416667 0.10666667 0.07083333
MAXENTROPY_PRECISION MAXENTROPY_RECALL MAXENTROPY_FSCORE
0.18833333 0.17666667 0.16750000
>
>
>
>
>
> dev.off()
null device
1
>