boot.err: Calculate .632 and .632+ Bootstrap Error Rate

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/mt_accest.R

Description

Calculate .632 bootstrap and .632 plus bootstrap error rate.

Usage

1
boot.err(err, resub)       

Arguments

err

Average error rate of bootstrap samples.

resub

A list including apparent error rate, class label and the predicted class label of the original training data (not resampled training data). Can be generated by classifier.

Value

A list with the following components:

ae

Apparent error rate.

boot

Average error rate of bootstrap samples(Same as err)

b632

.632 bootstrap error rate.

b632p

.632 plus bootstrap error rate.

Author(s)

Wanchang Lin

References

Witten, I. H. and Frank, E. (2005) Data Mining - Practical Machine Learning and Techniques. Elsevier.

Efron, B. and Tibshirani, R. (1993) An Introduction to the Bootstrap. Chapman & Hall.

Efron, B. and Tibshirani, R. (1997) Improvements on cross-validation: the .632+ bootstrap method. Journal of the American Statistical Association, 92, 548-560.

See Also

classifier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## iris data set
data(iris)
x      <- subset(iris, select = -Species)
y      <- iris$Species

## 10 bootstrap training samples 
pars   <- valipars(sampling = "boot", niter = 1, nreps = 10)
tr.idx <- trainind(y, pars=pars)[[1]]

## bootstrap error rate
err <- sapply(tr.idx, function(i){
  pred <- classifier(x[i,,drop = FALSE],y[i],x[-i,,drop = FALSE],y[-i], 
                     method = "knn")$err
})

## average bootstrap error rate
err <- mean(err)

## apparent error rate
resub  <- classifier(x,y,method = "knn")

## 
err.boot <- boot.err(err, resub)

mt documentation built on Feb. 2, 2022, 1:07 a.m.

Related to boot.err in mt...