agglda: LDA model aggregation

Description Usage Arguments Details Value References See Also

Description

aggregate LDA models based on iterated k-fold resampling method

Usage

1
2
agglda(X, Y, newdata = NULL, type = c("vote", "post"), k = 5, run = 100,
  threshold, prior = c("equal", "proportion"), suppress = FALSE)

Arguments

X

matrix/ dataframe of predictors, e.g. EFA coefficients/ PC scores selected using selectdim

Y

factor/ character giving the class, e.g. value obtained from getclass or sp value from routine1 object

newdata

matrix/ dataframe of newdata to be predicted. see details.

type

prediction based on the majority vote ("vote") from the submodels or based on the mean posterior probability from the submodels ("post")

k

the fold number for k-fold resampling

run

the iteration number for iteration of k-fold resampling

threshold

single numeric value of < 1. threshold of the proportion of majority vote or the mean posterior probability. predictions with less than the value will be reported as NA

prior

the prior used in lda models, "equal" means all classes have same prior, "proportion" means prior according to the classes weight in the training data.

suppress

logical. whether to suppress the progress monitoring output

Details

If newdata is provided, the function is in the prediction mode, the aggregated model will be built from X and Y and predicition is performed on newdata. Otherwise, if newdata = NULL (default) the function is in evaluation mode.

In evaluation mode, overall accuracy of the model and the by-class statistics are calculated, similar to that of mrkfcv2. However, the statistics are calculated based on the aggregated prediction. See reference for explanation on model aggregation and thresholding.

Value

accuracy

[evaluation mode] the overall accuracy in percent

conmat

[evaluation mode] confusion matrix

stat

[evaluation mode] matrix containing the statistics of each class, see details

total

[evaluation mode] the total percent of reported prediction after threshold. give NULL if threshold is not given

ind.prediction

matrix containing the prediction result on each training/ new specimens

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

kfcv, mrkfcv


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