classPriors: Class Priors

View source: R/classPriors.R

classPriorsR Documentation

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(s)

Eric Archer eric.archer@noaa.gov

See Also

balancedSampsize, confusionMatrix

Examples

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)


rfPermute documentation built on Aug. 24, 2023, 1:08 a.m.