miceCI {micer} | R Documentation |
miceCI
Description
Calculate confidence intervals (CIs) for MICE and associated metrics using bootstrap sampling and the percentile method.
Usage
miceCI(
reps = 200,
frac = 0.7,
lowPercentile,
highPercentile,
reference,
prediction,
mappings = levels(as.factor(reference)),
multiclass = TRUE,
positiveIndex = 1
)
Arguments
reps |
number of bootstrap replicates to use. Default is 200. |
frac |
proportion of samples to include in each bootstrap sample. Default is 0.7. |
lowPercentile |
lower percentile for confidence interval. Default is 0.025 for a 95% CI. |
highPercentile |
upper percentile for confidence interval. Default is 0.975 for a 95% CI. |
reference |
column of reference labels as factor data type. |
prediction |
column of predicted labels as factor data type. |
mappings |
names of classes (if not provided, factor levels are used). |
multiclass |
TRUE or FALSE. If TRUE, treats classification as multiclass. If FALSE, treats classification as binary. Default is TRUE. |
positiveIndex |
index for positive case for binary classification. Ignored for multiclass classification. Default is 1 or first factor level |
Details
Confidence intervals are estimated for overall accuracy, MICE, and all class-aggregated, macro-averaged metrics produced by mice() or miceCM(). Returns metric name, mean metric value, median metric value, lower confidence interval bounds (low.ci), and upper confidence interval bounds (upper.ci) as a dataframe object.
Value
dataframe object of metric name and estimated mean value, median value, and lower and upper CIs.
Examples
#Multiclass example
data(mcData)
ciResultsMC <- miceCI(rep=100,
frac=.7,
mcData$ref,
mcData$pred,
lowPercentile=0.025,
highPercentile=0.975,
mappings=c("Barren", "Forest", "Impervious", "Low Vegetation", "Mixed Dev", "Water"),
multiclass=TRUE)
print(ciResultsMC)
#Binary example
data(biData)
ciResultsBi <- miceCI(rep=100,
frac=.7,
biData$ref,
biData$pred,
lowPercentile=0.025,
highPercentile=0.975,
mappings = c("Mined", "Not Mined"),
multiclass=FALSE,
positiveIndex=1)
print(ciResultsBi)