I know thattune() in package e1071 is useful to choose the optimal parameters for the SVM regression.But I just don't know how to to select the suitable ranges for parameters like gamma,cost and epsilon?
x<-tune.svm(rg~.,data=train,kernel="radial",
gamma = c(0.01,0.03,0.1,0.3,1.3,10,30),cost=2^(2:9),epsilon =c(0.01,0.03,0.1,0.3,1.3,10,30) )
The parameters above is just chosen randomly. Any suggestions would be appreciated. Many thanks!!
ok. Here is my result with the train data after tune.svm,with the x axis being the fitted data and y axis being the actual data. Is there any idea on how to improve the SVM performance?
and the data in train set:
> head(train)
rg weather sex member_type annual_income Weekend age_group
1 0.035725277 6 2 3 1 2 3
2 1.693898548 6 2 1 5 2 1
3 0.009012839 1 2 3 1 1 3
4 0.014902879 6 2 3 2 2 3
6 0.003531616 6 2 3 1 1 2
7 0.001575542 6 1 3 2 1 3
Most people use exactly what you are using, which is a range that grows times 3. In some situations I have tried multiples of 1.5, that would be (0.01, 0.015, 0.03...). I improved my performance a little but not too much. It all depends on how long your training lasts.
I would try as minimum a smaller number like 0.0001 and as maximum 1000. Maybe 1000 is to much but I always try an order of magnitude bigger than what I think it's my maximum, that I would say it's 100.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With