tnr: Specificity, True negative rate

Description Usage Arguments Examples

View source: R/ModelMetrics.R

Description

True Negatives / (True Negatives + False Positives)

Usage

1
tnr(actual, predicted, cutoff = 0.5)

Arguments

actual

A vector of the labels

predicted

A vector of predicted values

cutoff

A cutoff for the predicted values

Examples

1
2
3
4
5
6
data(testDF)
glmModel <- glm(y ~ ., data = testDF, family="binomial")
Preds <- predict(glmModel, type = 'response')

tnr(testDF$y, Preds, cutoff = 0)
specificity(testDF$y, Preds, cutoff = 0)

ModelMetrics documentation built on March 26, 2020, 7:48 p.m.