svm_trn | R Documentation |
svm_trn allows assessing the final DEGs through a machine learning step by using svm in a cross validation process. This function applies a cross validation of n folds with representation of all classes in each fold. The 80% of the data are used for training and the 20% for test. An optimization of C and G hiperparameters is done at the start of the process.
svm_trn(data, labels, vars_selected, numFold = 10)
data |
The data parameter is an expression matrix or data.frame that contains the genes in the columns and the samples in the rows. |
labels |
A vector or factor that contains the labels for each of the samples in the data object. |
vars_selected |
The genes selected to classify by using them. It can be the final DEGs extracted with the function |
numFold |
The number of folds to carry out in the cross validation process. |
A list that contains five objects. The confusion matrix for each fold, the accuracy, the sensitibity and the specificity for each fold and each genes, and a vector with the best parameters found for the SVM algorithm after tuning.
dir <- system.file("extdata", package = "KnowSeq") load(paste(dir, "/expressionExample.RData", sep = "")) svm_trn(t(DEGsMatrix)[,1:10], labels, rownames(DEGsMatrix)[1:10], 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.