[R] handling constant factors in prediction using svm

Divyam divyamurali13 at gmail.com
Tue Oct 4 08:53:43 CEST 2011


Hi users!

I am fitting a model with several factor variables as independents using
svm. since there are lots of categorical variables,the training and test
data sets have been created using dummy.data.frame option from dummies
package. I have a factor A in the training data set with 2 levels (0,1).In
the test set, this factor A has only 1 level (1) and hence when applying
dummy.data.frame, the variable gets dropped(and that's how i want it too).
The problem comes when I am trying to predict the test data as an error is
thrown saying A0 object is not found. Is there anyway  to solve this
problem?

Thanks
Divya

--
View this message in context: http://r.789695.n4.nabble.com/handling-constant-factors-in-prediction-using-svm-tp3870093p3870093.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list