Description Usage Arguments Value Author(s) Examples
View source: R/classification.R
This function performs classification through the Support Vector Machines (SVM) algorithm. The algorithm applies on the "exemplars" dataset. It produces a classification result either on the training set or on a validation set. This function estimates how well the selected "genes" from mAP-KL method discriminate between two phenotypes.The default SVM settings are: "linear" kernel and 5-folds cross-validation. Regarding the parameters for the "linear" kernel ,cost parameter, and for the "radial" kernel, cost and gamma parameters, are estimated automatically through the tune.svm function as described in e1071 r-package.
1 | classification(trExemplObj,classLabels,valExemplObj=NULL,kf=5,kernel="linear")
|
trExemplObj |
The exemplars train eSet object. |
classLabels |
The varLabels name in the eSet object where the class labels are stored e.g "type". |
valExemplObj |
The exemplars validation eSet object (if not NULL). |
kf |
The k-folds value of the cross-validation parameter.The default value is 5-folds. By setting "Loo" or "LOO" a Leave-One-Out Cross Validation is performed |
kernel |
The type of kernel used for the classification analysis.The default kernel is "linear" |
classL |
The labels of the train set |
valClassL |
The labels of the validation set if not NULL |
predLbls |
The predicted labels according to the classification analysis |
Argiris Sakellariou
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(mAPKLData)
data(mAPKLData)
breast <- sampling(Data=mAPKLData, valPercent=40, classLabels="type", seed=135)
normTrainData <- preprocess(breast$trainData)
normTestData <- preprocess(breast$testData)
exprs(breast$trainData)<-normTrainData$clL2.normdata
exprs(breast$testData)<-normTestData$clL2.normdata
out.clL2 <- mAPKL(trObj=breast$trainData, classLabels="type",
valObj=breast$testData,dataType=7)
clasPred <- classification(trExemplObj=out.clL2@exemplTrain, classLabels="type",
valExemplObj=out.clL2@exemplTest)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.