Displaying 1 result from an estimated 1 matches for "catgegorical".
Did you mean:
categorical
2010 May 14
4
Categorical Predictors for SVM (e1071)
...ng "svm"
from library(e1071). If I have multiple categorical predictors, should they
just be included as factors? Take a simple artificial data example:
x1<-rnorm(500)
x2<-rnorm(500)
#Categorical Predictor 1, with 5 levels
x3<-as.factor(rep(c(1,2,3,4,5),c(50,150,130,70,100)))
#Catgegorical Predictor 2, with 3 levels
x4<-as.factor(rep(c("R","B","G"),c(100,200,200)))
#Response
y<-rep(c(-1,1),c(275,225))
class<-as.factor(y)
svmdata<-cbind(class,x1,x2,x3,x4)
mod1<-svm(class~.,data=svmdata,type="C-classification")
OR
should each...