View source: R/cluster_analysis.R
calculate_accuracy | R Documentation |
Fit a model with fit_model()
and calculate posterior probabilities of
writership with analyze_questioned_documents()
of a set of test documents
where the ground truth is known. Then use calculate_accuracy()
to measure
the accuracy of the fitted model on the test documents. Accuracy is calculated as
the average posterior probability assigned to the true writer.
calculate_accuracy(analysis)
analysis |
Writership analysis output by
|
The model's accuracy on the test set as a number
# calculate the accuracy for example analysis performed on test documents and a model with 1 chain
calculate_accuracy(example_analysis)
## Not run:
main_dir <- "/path/to/main_dir"
test_images_dir <- "/path/to/test_images"
analysis <- analyze_questioned_documents(
main_dir = main_dir,
questioned_docs = test_images_dir,
model = model,
num_cores = 2,
writer_indices = c(2, 5),
doc_indices = c(7, 18)
)
calculate_accuracy(analysis)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.