Learn R Programming

rfPermute (version 2.5.2)

classPriors: Class Priors

Description

Compute the class classification priors and class-specific model binomial p-values using these priors as null hypotheses.

Usage

classPriors(x, sampsize)

Arguments

x

a rfPermute or randomForest model object.

sampsize

the vector of sample sizes used to construct the model. If provided, must have length equal to number of classes. If set to NULL, priors will be computed assuming empirical sample sizes.

Author

Eric Archer eric.archer@noaa.gov

See Also

balancedSampsize, confusionMatrix

Examples

Run this code
library(randomForest)
data(mtcars)

# random sampling with replacement
rf <- randomForest(factor(am) ~ ., mtcars)
confusionMatrix(rf)
classPriors(rf, NULL)

# balanced design
sampsize <- balancedSampsize(mtcars$am)
rf <- randomForest(factor(am) ~ ., mtcars, replace = FALSE, sampsize = sampsize)
confusionMatrix(rf)
classPriors(rf, sampsize)

Run the code above in your browser using DataLab