Description:
- For a data set, I would like to apply
SVM
by using radial basis function (RBF
) kernel withWeston, Watkins native multi-class
. - The rbf kernel parameter
sigma
must be tuned and I want to usek-folds cross validation
to do this. I consider a fixedC
.
Solution:
It seems that I can use the nice package mlr to do this! So, to tune the rbf
parameter sigma
using CV
for MSVM
classification, (using this tutorial)
#While C is fix = 3, define a range to search sigma over it. Search between [10^{-6}, 10^{6}]
num_ps = makeParamSet(
makeDiscreteParam("C", values = 3),
makeNumericParam("sigma", lower = -6, upper = 6, trafo = function(x) 10^x)
)
#Define the Grid search method
ctrl = makeTuneControlGrid()
#Apply the k-folds CV
rdesc = makeResampleDesc("CV", iters = 3L)
res = tuneParams("classif.ksvm", task = iris.task, resampling = rdesc,
par.set = num_ps, control = ctrl)
Question:
For this part
res = tuneParams("classif.ksvm", task = iris.task, resampling = rdesc,
par.set = num_ps, control = ctrl)
According to the documentation, by using the integrated learner classif.ksvm, I'm asking to apply the multiclass classification that is defined in the package ksvm.
How can I know which method and kernel type are used? I mean, how to force the learner classif.ksvm
to use the classification type (kbb-svc
) and the kernel (rbfdot
) which are already defined in ksvm
?
If this is not possible, then how to define a new learner with all of my requirements?