Skip to content
Back to formatted view

Raw Message

Message-ID: <1354464642740-4651652.post@n4.nabble.com>
Date: 2012-12-02T16:10:42Z
From: rahul143
Subject: e1071 SVM: Cross-validation error confusion matrix

Hi, 

I ran two svm models in R e1071 package: the first without cross-validation
and the second with 10-fold cross-validation. 

I used the following syntax: 

#Model 1: Without cross-validation: 
> svm.model <- svm(Response ~ ., data=data.df, type="C-classification",
> kernel="linear", cost=1) 
> predict <- fitted(svm.model) 
> cm <- table(predict, data.df$Response) 
> cm 

#Model2: With 10-fold cross-validation: 
> svm.model2 <- svm(Response ~ ., data=data.df, type="C-classification",
> kernel="linear", cost=1, cross=10) 
> predict2 <- fitted(svm.model2) 
> cm2 <- table(predict2, data.df$Response) 
> cm2 

However, when I compare cm and cm2, I notice that the confusion matrices are
identical although the accuracy of each model is diffent. What am I doing
wrong? 
  
Thanks for you help, 




-----
TO GET MORE DETAILS CLICK HERE  
--
View this message in context: http://r.789695.n4.nabble.com/e1071-SVM-Cross-validation-error-confusion-matrix-tp4651652.html
Sent from the R help mailing list archive at Nabble.com.