[datatable-help] svm e1071 call - different results

agent dunham crosspide at hotmail.com
Thu Jun 29 15:56:04 CEST 2017


Dear community, 

I don't know which is the proper call for svm at e1071, as I'm obtaining
really different results when predicting. 

Find attached my data. 

This is what I'm trying:

*TYPE1*

mod = svm(train[, 8] ~ . , data= train)
pred.svm <- predict (mod, train)
error.svm <-  train$revenues - pred.svm
pred.svm.test <- predict (mod, test)
svmPredictionRMSE <- rmse(error.svm) 
/*0.05239259*/
error.svm.test <-  test$revenues - pred.svm.test 
svmPredictionRMSE.test <- rmse(error.svm.test) 
/*0.06932511*/

*TYPE2*

mod.1 = svm(train[, -8] , train[, 8])
pred.1.svm <- predict (mod.1, train[, -8])
error.1.svm <-  train$revenues - pred.1.svm
rmse(error.1.svm)  
/*0.3695311*/
pred.1.svm.test <- predict (mod.1, test[, -8])
error.1.svm.test <-  test$revenues - pred.1.svm.test
rmse(error.1.svm.test)  
/*0.412292*/


train.txt <http://r.789695.n4.nabble.com/file/n4740595/train.txt>  

test.txt <http://r.789695.n4.nabble.com/file/n4740595/test.txt>  


And rmse:

function(error)
{
         sqrt(mean(error^2, na.rm= TRUE))
}


I also tried: 

mod2 = svm(formula = train1[, 8] ~ as.matrix(train1[, -8]), data = train)
If this is correct, how do I have to write the corresponding predict?


Thanks in advance, 



--
View this message in context: http://r.789695.n4.nabble.com/svm-e1071-call-different-results-tp4740595.html
Sent from the datatable-help mailing list archive at Nabble.com.


More information about the datatable-help mailing list