Last data update: 2014.03.03

R: Cross-Validation with Support Vector Machine.
PLS.SVM.CVR Documentation

Cross-Validation with Support Vector Machine.

Description

This is function performs a 10-fold cross validation on a given data set using the Support Vector Machine (SVM) classifier. The SVM classifier is performed on the score of the Partial least squares (PLS). The output is a vector of predicted labels.

Usage

PLS.SVM.CV(x,cl,constrain,ncomp=5, ...)

Arguments

x

a matrix.

cl

a classification vector.

constrain

a vector of nrow(data) elements. Sample with the same identificative constrain will be split in the training set or in the test test of cross-validation together.

ncomp

number of component of PLS to consider.

...

parameter for svm classifier.

Details

PLS-SVM classifier was used successfully in Bertini, et al. (2012) and Aimetti, et al. (2012) to classify metabolomic data.

Value

The function returns a vector of predicted labels.

Author(s)

Stefano Cacciatore and Leonardo Tenori

References

Bertini I, Cacciatore S, Jensen BV, et al.
Metabolomic NMR fingerprinting to identify and predict survival of patients with metastatic colorectal cancer.
Cancer Res 2012;72(1):356-64.

Aimetti M, Cacciatore S, Graziano A, Tenori L.
Metabonomic analysis of saliva reveals generalized chronic periodontitis signature.
Metabolomics 2012;8(3):465-74.

See Also

KNN.CV,PCA.CA.KNN.CV

Examples

data(lymphoma)
class=as.factor(unlist(lymphoma$class))
results=PLS.SVM.CV(lymphoma$data,class,1:length(class))
levels(results)=levels(class)
table(results,class)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(KODAMA)
Loading required package: e1071
Loading required package: plsgenomics
Loading required package: MASS
Loading required package: boot
Loading required package: parallel
Loading required package: class

Attaching package: 'KODAMA'

The following object is masked from 'package:plsgenomics':

    transformy

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/KODAMA/PLS.SVM.CV.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PLS.SVM.CV
> ### Title: Cross-Validation with Support Vector Machine.
> ### Aliases: PLS.SVM.CV
> ### Keywords: croos-validation
> 
> ### ** Examples
> 
> data(lymphoma)
> class=as.factor(unlist(lymphoma$class))
> results=PLS.SVM.CV(lymphoma$data,class,1:length(class))
> levels(results)=levels(class)
> table(results,class)
       class
results B-CLL DLBCL FL
  B-CLL    11     0  0
  DLBCL     0    42  1
  FL        0     0  8
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>