CV: CV

Description Usage Arguments Value See Also Examples

View source: R/CV.R

Description

This function trains a shrinkage discriminant analysis (sda) classifier as in Training in a k-fold cross validation. A data.frame with class labels and predictions is returned which can be used for prediction power estimation.

Usage

1
CV(abt, feats, labs, k = 5, ...)

Arguments

abt

num matrix containing training data with rows as observations and columns as features

feats

data.frame with columns name and value which identifies the features (columns) of abt with chr values

labs

vector defining class labels of rows in training data

...

arguments passed to link{Training}

Value

data.frame with class labels and predictions by the classifier

See Also

Other machine learning: Convert, FeatureExtraction, Prediction, Training

Examples

1
2
3
4
5
abt1 <- matrix(sample(0:1, 1000*100, replace = TRUE), 1000, 100)
feats1 <- data.frame(name = "test", value = 1:100)
labs1 <- sample(0:1, 1000, replace = TRUE)
err <- CV(abt1, feats1, labs1)
(acc <- sum(err$class == err$prediction) / nrow(err) * 100)

mRcSchwering/abacus documentation built on May 21, 2019, 9:18 a.m.