sim_metrics: This function computes and returns metrics given the number...

View source: R/sim_metrics.R

sim_metricsR Documentation

This function computes and returns metrics given the number of true positives, false positives, true negatives, and false negatives that were observed in a prediction task

Description

This function computes metrics for precision, recall, accuracy, specificity, false discovery rate, false positive rate, and the f1 score returning the metrics in a named list and computing them from inputs of the number of true positives tp, the number of false positives fp, the number of true negatives tn, the number of false negatives fn. For any metric, if the denominator is equal to 0, the returned value for that metric is NA.

Usage

sim_metrics(tp, fp, tn, fn)

Arguments

tp

an integer for the number of true positives

fp

an integer for the number of false positives

tn

an integer for the number of true negatives

fn

an integer for the number of false negatives

Value

metric_list a named list returning precision, recall, accuracy, specificity, fpr, fdr, and f1 (the f1 score)


mccoy-lab/rhapsodi documentation built on July 27, 2022, 3:56 a.m.