Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

How do I decide on the optimal value of cost in SVM in R

$
0
0

@pagal_guy wrote:

hello,

While trying to understand how the cost affects the performance of an SVM I noticed a few things:
m <- svm(quality_bin ~ ., data = training, cost = 0.1) # here the cost value is 0.1
pred <- predict(m,testing)
confusionMatrix(pred, testing$quality_bin)

For this the output is:

  m <- svm(quality_bin ~ ., data = training, cost = 0.50) # here the cost value is 0.1
    pred <- predict(m,testing)
    confusionMatrix(pred, testing$quality_bin)

here we can see that both the Accuracy and Kappa have increase but when I do:
m <- svm(quality_bin ~ ., data = training, cost = 1) # here the cost value is 0.1
pred <- predict(m,testing)
confusionMatrix(pred, testing$quality_bin)

Here the Accuracy has not increased but Kappa has increased slightly.

So my questions is:
1.If Accuracy is increasing shouldn't Kappa also increase?
2.How do I decide on the optimal value of cost in SVM?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles