[R] cross validation using e1071:SVM

Max Kuhn mxkuhn at gmail.com
Tue Nov 23 21:59:48 CET 2010


Neeti,

I'm pretty sure that the error is related to the confusionMAtrix call,
which is in the caret package, not e1071.

The error message is pretty clear: you need to pas in two factor
objects that have the same levels. You can check by running the
commands:

   str(pred_true1)
   str(species_test)

Also, caret can do the resampling for you instead of you writing the
loop yourself.

Max



More information about the R-help mailing list