Description Usage Arguments Value Examples
svm_test allows assessing the final DEGs through a machine learning step by using SVM with a test dataset. An optimization of C and G hiperparameters is done at the start of the process.
1 | svm_test(train, labelsTrain, test, labelsTest, vars_selected, bestParameters)
|
train |
The train parameter is an expression matrix or data.frame that contains the train dataset with the genes in the columns and the samples in the rows. |
labelsTrain |
A vector or factor that contains the train labels for each of the samples in the train object. |
test |
The test parameter is an expression matrix or data.frame that contains the test dataset with the genes in the columns and the samples in the rows. |
labelsTest |
A vector or factor that contains the test labels for each of the samples in the test object. |
vars_selected |
The genes selected to classify by using them. It can be the final DEGs extracted with the function |
bestParameters |
Best values for C and gamma parameters selected during the training phase. |
A list that contains four objects. The confusion matrix, the accuracy, the sensitibity and the specificity for each genes.
1 2 3 4 5 6 7 8 9 10 | dir <- system.file("extdata", package="KnowSeq")
load(paste(dir,"/expressionExample.RData",sep = ""))
trainingMatrix <- t(DEGsMatrix)[c(1:4,6:9),]
trainingLabels <- labels[c(1:4,6:9)]
testMatrix <- t(DEGsMatrix)[c(5,10),]
testLabels <- labels[c(5,10)]
results_svm_cv <- svm_trn(trainingMatrix, trainingLabels, rownames(DEGsMatrix)[1:10], 2)
bestParameters <- results_svm_cv$bestParameters
svm_test(trainingMatrix, trainingLabels, testMatrix, testLabels,rownames(DEGsMatrix)[1:10], bestParameters)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.