Learn R Programming

mobForest (version 1.3.1)

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

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

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

Run this code
# NOT RUN {
# 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)	

# }

Run the code above in your browser using DataLab