Description Usage Arguments Value Examples
This function performs cross validation to find best combinatiuon of hyper perameters and cost and uses this model to provide prediction performace results.
1 2 3 4 5 6 7 8 9 10 11 | SVM.nfoldcv(
data,
outcome,
train.samples,
C,
kernels,
degree,
scale,
sigma,
nfold = 10
)
|
data |
List of data matrices for each pathways for each pathway |
outcome |
Binary outcome variable for MKL |
train.samples |
Vector of indices that will be used as training samples |
C |
Vector of canduidate cost parameters |
kernels |
vector of kernel types |
degree |
Degree of polynomial kernel matrix |
scale |
Leading coefficient on the polynomial kernel |
sigma |
Hyperparameter for the radial basis kernel |
nfold |
Number of folds used in cross validation |
cm Confustion matrix along with a variety of accuracy statistics
best.model Model that had the highest accuracy with nfold cross validation
1 2 3 4 5 6 7 | data(benchmark.data)
example.data=benchmark.data[[1]]
training.samples=sample(1:nrow(example.data), floor(0.7*nrow(example.data)),replace=FALSE)
C=2^c(-1,1)
#Find the best cost parameter within the provided range if a linear kernel is used
SVM.nfoldcv(example.data[,1:2], as.factor(example.data[,3]),training.samples,C,
'linear',0,0,0,nfold=3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.