creates a summary with precision, recall, and F1 scores.

Share:

Description

Creates a summary with precision, recall, and F1 scores for each algorithm broken down by unique label.

Usage

1
create_precisionRecallSummary(container, classification_results, b_value = 1)

Arguments

container

Class of type matrix_container-class generated by the create_container function.

classification_results

A cbind() of result objects returned by classify_model, or the object returned by classify_models.

b_value

b-value for generating precision, recall, and F-scores statistics.

Author(s)

Loren Collingwood <lorenc2@uw.edu>, Timothy P. Jurka <tpjurka@ucdavis.edu>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)
precision_recall_f1 <- create_precisionRecallSummary(container, results)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.