Description Usage Arguments Details Examples
Returns the rate at which false positives are identified in a classification problem given a certain threshold. Especially for logistic/poisson regression whether a model correctly classifies a binary outcome depends on the threshold.
1 | falseposrate(threshold, truth, fitted)
|
threshold |
a value between 0 and 1 for the value at which an outcome is classified |
truth |
a vector of [0 | 1] values representing the true classification |
fitted |
a vector in the range [0,1] values representing the predicted classification |
This function is primarily used to calculate values for the Receiver Operating Characteristics (ROC) curve function.
1 2 3 4 5 6 | m0 = glm(outcome ~ predictor1 + predictor2, family = binomial(), data = train)
testprobs = predict(m0, newdata = test, type = "response")
truth = train$outcome
falseposrate(0.5, truth, testprobs)
# Most useful for understanding the rate of true positives across a range of thresholds
sapply(0:10 / 10, function(x) {falseposrate(x, truth = truth, fitted = testprobs)})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.