[R] tune svm

jparga argajuan at yahoo.com.ar
Thu May 13 21:54:39 CEST 2010


Hello, I hope you can help me!
I`m trying to tune svm parameters: cost and gamma for a landsat image
classification, but I get an error and I can't understand it.
I write this: 
> tune(svm, Class~., data = mdt01bis, ranges = list(gamma = 2^(-15:3), cost
> = 2^(-5:15)))
and R gives:
Error en predict.svm(model, if (!is.null(validation.x)) validation.x else if
(useFormula) data[-train.ind[[sample]],  : 
  test data does not match model !

The matrix is as follows, with 720 rows and 4 categories in column Class
B1       B2       B3       B4       B5       B6       Class
  [1,] "0.0450" "0.0599" "0.1169" "0.1820" "0.3040" "0.2826" "CV" 
  [2,] "0.0481" "0.0630" "0.1222" "0.1854" "0.3040" "0.2891" "CV" 
  [3,] "0.0497" "0.0630" "0.1329" "0.1988" "0.2929" "0.2794" "CV" 
  [4,] "0.0450" "0.0567" "0.1196" "0.1854" "0.2973" "0.2859" "CV" 

and the svm:
> svm(Class~., data=mdt01bis, method="C-classification", kernel="radial",
> cost=10, gamma=0.1) 
works ok.
Could you please tell me what is wrong?
Thanks a lot!
-- 
View this message in context: http://r.789695.n4.nabble.com/tune-svm-tp2209804p2209804.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list