logistic.acc: Contingency table: Predicted vs. Observed Outcomes

Description Usage Arguments Examples

View source: R/logistic.acc.R

Description

This function takes predicted probabilities (for out of bag cases) obtained through logistic regression-based tree models and converts them into binary classes (based on specified probability threshold). The predicted classifications are then compared to actual binary response.

Usage

1
logistic.acc(response, predicted, prob_thresh = 0.5)

Arguments

response

A vector of binary classes of out-of-cases for a given tree.

predicted

A vector of predicted probabilities of out-of-cases using same tree.

prob_thresh

Probability threshold for classification (default = .5).

Examples

1
2
3
4
# We should get 15 predictions correct and miss 5
response <- matrix(c(rep(0,10), rep(1,10)))
predicted <- c(rep(.1,15), rep(.8,5))
logistic.acc(response, predicted, .5)	

RTIInternational/mobForest documentation built on Aug. 3, 2019, 8:28 a.m.