Hej all,
actually i try to tune a SVM in R and use the package "e1071" wich works
pretty well.
I do some gridsearch in the parameters and get the best possible parameters
for classification.
Here is my sample code
type<-sample(c(-1,1) , 20, replace = TRUE )
weight<-sample(c(20:50),20, replace=TRUE)
height<-sample(c(100:200),20, replace=TRUE)
width<-sample(c(30:50),20,replace=TRUE)
volume<-sample(c(1000:5000),20,replace=TRUE)
data<-cbind(type,weight,height,width,volume)
train<-as.data.frame(data)
library("e1071")
features <- c("weight","height","width","volume")
(formula<-as.formula(paste("type ~ ", paste(features, collapse= "+"))))
svmtune=tune.svm(formula, data=train, kernel="radial", cost=2^(-2:5),
gamma=2^(-2:1),cross=10)
summary(svmtune)
My question is if there is a way to tune the features.
So in other words - what i wanna do is to try all possible combinations of
features : for example use only (volume) or use (weight, height) or use
(height,volume,width) and so on for the SVM and to get the best combination
back.
Best wishes
Uwe
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.