SvmFit: support vector machine

Description Usage Arguments Value Author(s) See Also Examples

View source: R/SvmFit.R

Description

Classification using support vector machine (svm) algorithm

Usage

1
2
3
4
SvmFit(featuredata, groupdata, kernel = "radial", cost = 1, gamma = NULL,
  crossvalid = TRUE, k = 5, tune = FALSE, pred = TRUE,
  pfeaturedata = featuredata, pgroupdata = groupdata, rocplot = TRUE,
  saveoutput = FALSE, outputname = "svm", main = NULL, ...)

Arguments

featuredata

featuredata A data frame in the featuredata format. This is a dataframe with metabolites in columns and samples in rows. Unique sample names should be provided as row names. See NormalizeMets Vignette for details.

groupdata

A vector with group names.

kernel

The kernel used. The default is the radial basis function with type C-classification.

cost

of constraint violation, defaults to 1.

gamma

parameter used for the kernel

crossvalid

A logical indicating whether cross-validation needs to be conducted

k

An integer specifying the k-fold cross-validation. Default is set to 5.

tune

A logical with the default set to FALSE. If TRUE, a grid search will be conducted to tune the hyperparameters, over parameter ranges supplied by the user.

pred

whether the predictions should be made

pfeaturedata

The test dataset for the predictions. The default is featuredata

pgroupdata

The test groupdata for the predictions. The default is groupdata

rocplot

A logical indicating whether a receiver operating characteristic curve needs to be plotted, along with the area under the curve (AUC) printed.

saveoutput

A logical indicating whether the outputs should be saved in the format write.svm

outputname

The name of the output file if the output has to be saved.

main

Plot title.

...

Arguments to be passed on to other methods.

Value

If tune=FALSE, an object of class "svm" svm containing the fitted model or if tune=TRUE, an object of class tune

Author(s)

Alysha M De Livera, Gavriel Olshansky

See Also

tune

Examples

1
2
3
4
5
6
 data(alldataC)
SvmFit(featuredata=alldataC$featuredataC, 
       groupdata=alldataC$groupdataC,
       crossvalid=TRUE,
       k=5,
       rocplot = TRUE)

NormalizeMets documentation built on May 1, 2019, 10:26 p.m.