Last data update: 2014.03.03
R: an S4 class containing the analytics for a classified set of...
analytics_virgin-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 and a document summary. This class is returned if virgin=TRUE
in create_container
.
Objects from the Class
Objects could in principle be created by calls of the
form new("analytics_virgin", ...)
.
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 how many documents were classified with each label
document_summary
Object of class "data.frame"
:
stores the analytics for each document, including all available raw data associated with the learning process
Author(s)
Timothy P. Jurka <tpjurka@ucdavis.edu>
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=TRUE)
models <- train_models(container, algorithms=c("MAXENT","SVM"))
results <- classify_models(container, models)
analytics <- create_analytics(container, results)
summary(analytics)
Results
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_virgin-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: analytics_virgin-class
> ### Title: an S4 class containing the analytics for a classified set of
> ### documents.
> ### Aliases: analytics_virgin-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=TRUE)
> models <- train_models(container, algorithms=c("MAXENT","SVM"))
> results <- classify_models(container, models)
> analytics <- create_analytics(container, results)
>
> summary(analytics)
SUMMARY OF LABEL CLASSIFICATION
NUM_CONSENSUS_CODED NUM_PROBABILITY_CODED PROP_CONSENSUS_CODED
1 0 0 0
2 0 0 0
3 0 0 0
4 0 0 0
5 0 0 0
6 0 0 0
8 0 0 0
10 0 0 0
12 0 0 0
13 1 1 4
15 0 0 0
16 0 0 0
17 1 1 4
18 0 0 0
19 23 23 92
20 0 0 0
24 0 0 0
26 0 0 0
28 0 0 0
29 0 0 0
30 0 0 0
31 0 0 0
PROP_PROBABILITY_CODED
1 0
2 0
3 0
4 0
5 0
6 0
8 0
10 0
12 0
13 4
15 0
16 0
17 4
18 0
19 92
20 0
24 0
26 0
28 0
29 0
30 0
31 0
>
>
>
>
>
> dev.off()
null device
1
>