Description Usage Arguments Author(s) Examples
View source: R/recall_accuracy.R
Given the true labels to compare to the labels predicted by the algorithms, calculates the recall accuracy of each algorithm.
1 | recall_accuracy(true_labels, predicted_labels)
|
true_labels |
A vector containing the true labels, or known values for each document in the classification set. |
predicted_labels |
A vector containing the predicted labels, or classified values for each document in the classification set. |
Loren Collingwood, Timothy P. Jurka
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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("RF","SVM"))
results <- classify_models(container, models)
analytics <- create_analytics(container, results)
recall_accuracy(analytics@document_summary$MANUAL_CODE,
analytics@document_summary$RF_LABEL)
recall_accuracy(analytics@document_summary$MANUAL_CODE,
analytics@document_summary$SVM_LABEL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.