threcv: Optimize threshold on posterior probability

Description Usage Arguments Details Value References See Also

View source: R/threcv.R

Description

To estimate the effect of setting a threshold on posterior probability to reject "unsure" predictions.

Usage

1
threcv(X, Y, saveplot = FALSE, plotsize = 1000, run = 30, k = 5, level)

Arguments

X

matrix of PC scores from rGPA object (the score value)

Y

a factor giving the grouping, e.g. the sp value from routine1 object or obtain from getclass

saveplot

logical. The plot will be saved if TRUE, and no plot is displayed in the window. Note that outliers of boxplot are not plotted.

plotsize

numeric. Plot size for the plot saved into file (used only when saveplot=TRUE), unit in pixel.

run

argument to be passed to mrkfcv

k

argument to be passed to mrkfcv

level

numeric vector giving the threshold range to be tested. see details.

Details

only lda is supported now. lda decide the class (e.g. species) based on the calculated posterior probability. New sample is assigned to the class that has the higher posterior probability. We can reject the classification result if the posterior probability is low (the "unsure" classification). In this way we can increase the overall accuracy (correct predictions out of all the reported results), but the tradeoff is the decrease in number of reported classification result. The function test the threshold value of 0.50 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 0.99 if level is not provided. Since thresholding is just an option, the choice of threshold value is really arbitrary and depends on one's objectives.

Value

a matrix and a plot are returned, giving the overall accuracy and the total reported prediction percentage over a range of threshold values.

References

Beleites, C., & Salzer, R. (2008). Assessing and improving the stability of chemometric models in small sample size situations. Analytical and Bioanalytical Chemistry, 390(5), 1261-1271.

See Also

Similar: pccv, harcv

Which this function wraps: mrkfcv


jinyung/otolith documentation built on May 19, 2019, 10:36 a.m.