A matrix with the available data, the predictor variables.
ina
A vector of data. The response variable, which is categorical (factor is acceptable).
type
The type of naive Bayes, "beta", "logitnorm", "cauchy", "laplace", "gamma", "normlog" or "weibull". For the last 4 distributions, the negative of the logarithm of the compositional data is applied first.
folds
A list with the indices of the folds.
nfolds
The number of folds to be used. This is taken into consideration only if "folds" is NULL.
stratified
Do you want the folds to be selected using stratified random sampling? This preserves the analogy of the samples of each group.
Make this TRUE if you wish.
seed
You can specify your own seed number here or leave it NULL.
pred.ret
If you want the predicted values returned set this to TRUE.
Value
A list including:
preds
If pred.ret is TRUE the predicted values for each fold are returned as elements in a list.
crit
A vector whose length is equal to the number of k and is the accuracy metric for each k.
For the classification case it is the percentage of correct classification.
References
Friedman J., Hastie T. and Tibshirani R. (2017). The elements of statistical learning.
New York: Springer.