Learn R Programming

MAIT (version 1.6.0)

Validation: Cross validated classification over the output of the function signPeaksAnova or function TStudent2Clases

Description

Function Validation performs a cross-validated classification using three different classifiers: KNN, PLSDA and SVM. The output comes in a table with the classification ratio and its standard error. The classification ratio is weighted to take into account the different sample number of each class.

Usage

Validation(Iterations=NULL, MAIT.object=NULL, trainSamples=NULL, PCAscale=FALSE, PCAcenter=TRUE, RemoveOnePeakSpectra=FALSE, tuneSVM=FALSE, scale=TRUE)

Arguments

Iterations
Number of iterations to be performed in the classifications. For each iteration a new training group is randomly chosen.
MAIT.object
A MAIT-class object where significant features have already been found.
trainSamples
Number of samples per class to construct the train dataset.
PCAscale
If method="PCA" and PCAscale is set to TRUE, then the data is scaled following the prcomp function. If it is set to TRUE, scale input is ignored.
PCAcenter
If method="PCA" and PCAscale is set to TRUE, then the data is centered following the prcomp function. If it is set to TRUE, scale input is ignored.
RemoveOnePeakSpectra
If it is set to TRUE, all the one-peak spectra are deleted from the dataSet and the resulting spectralData object will only contain spectra with more than one peak.
tuneSVM
If it is set to TRUE, a tune of parameters is performed before the SVM calculus.
scale
If it is set to TRUE, the data is scaled through the spectral mean value. Set to TRUE by default.

Value

The numerical results of the classification per class and per classifier are saved in a MAIT-class object. Additionally, a table is also included in the output both in the list (field table) and printed as a csv file in the folder (working directory)/Validation. A boxplot is also printed as a png in the same folder showing the differences between classifiers. The confusion matrices of each iteration and classifier are also stored as csv files.

See Also

peakAggregation spectralAnova spectralTStudent spectralSigFeatures

Examples

Run this code
data(MAIT_sample)
MAIT<-spectralSigFeatures(MAIT,p.adj="fdr",parametric=TRUE)
MAIT <- Validation(Iterations = 20, trainSamples= 15, MAIT.object = MAIT)

Run the code above in your browser using DataLab