I am new to machine learning and currently reading a paper about a ANN modelling in which they have divided their dataset into Training , validation and testing set. I have carried out some minor SVM regression studies of my own using R (e1071); in which I have used only Training Set and testing set but no validation test to create model. I have optimized cost and gamma of my SVR model using inbuilt tune() function.
And this is a sample code
library(e1071) set.seed(3) data = data.frame(matrix(rnorm(100*5), nrow=100)) train=data[1:70,] test=data[71:100,] op=tune(svm,X1 ~ ., data=train,kernel="radial",ranges=list(cost=c(0.001,0.01),gamma=c(0.5,0.1))) fit = op$best.model summary(fit) pred=predict(fit,test)
So is it necessary to use validation set in SVR. if yes how can I programmatically implement validation set in the above code.