Validation: Cross validated classification over the output of the...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/Validation.R

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

1
2
3
4
5
6
7
8
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.

Author(s)

Francesc Fernandez, francesc.fernandez.albert@upc.edu

See Also

peakAggregation spectralAnova spectralTStudent spectralSigFeatures

Examples

1
2
3
data(MAIT_sample)
MAIT<-spectralSigFeatures(MAIT,p.adj="fdr",parametric=TRUE)
MAIT <- Validation(Iterations = 20, trainSamples= 15, MAIT.object = MAIT)

MAIT documentation built on Nov. 8, 2020, 5:43 p.m.