gkmsvm_train | R Documentation |
Using the kernel matrix created by 'gkmsvm_kernel', this function trains the SVM classifier. Here we rely on the 'kernlab' package, and merely provide a wrapper function.
gkmsvm_train(kernelfn, posfn, negfn, svmfnprfx, Type="C-svc", C=1, shrinking=FALSE, ...)
kernelfn |
kernel matrix file name |
posfn |
positive sequences file name |
negfn |
negative sequences file name |
svmfnprfx |
output SVM model file name prefix |
Type |
optional: SVM type (default='C-svc'), see 'kernlab' documentation for more details. |
C |
optional: SVM parameter C (default=1), see 'kernlab' documentation for more details. |
shrinking |
optional: shrinking parameter for kernlab (default=FALSE), see 'kernlab' documentation for more details. |
... |
optional: additional SVM parameters, see 'kernlab' documentation for more details. |
Trains SVM classifier and generates two files: [svmfnprfx]_svalpha.out for SVM alphas and the other for the corresponding SV sequences ([svmfnprfx]_svseq.fa)
Mahmoud Ghandi
#Input file names:
posfn= 'test_positives.fa' #positive set (FASTA format)
negfn= 'test_negatives.fa' #negative set (FASTA format)
testfn= 'test_testset.fa' #test set (FASTA format)
#Output file names:
kernelfn= 'test_kernel.txt' #kernel matrix
svmfnprfx= 'test_svmtrain' #SVM files
outfn = 'output.txt' #output scores for sequences in the test set
# gkmsvm_kernel(posfn, negfn, kernelfn); #computes kernel
# gkmsvm_train(kernelfn,posfn, negfn, svmfnprfx); #trains SVM
# gkmsvm_classify(testfn, svmfnprfx, outfn); #scores test sequences
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.