[R] Interpreting predictions of svm

Jessica Streicher j.streicher at micromata.de
Wed Aug 8 13:20:16 CEST 2012


You should give us the data is what you should do :)

Aside from that: you can only make probability predictions if you activated it when making the model.


On 07.08.2012, at 17:23, Camomille wrote:

> Hi, I have some difficulties in interpreting the prediction of a svm model
> using the package e1071.
> 
> y1 is the variable I want to predict. It is of type factor and has got two
> levels:  "< 50%" and "> 50%".
> z is the dataset.
> 
>> model <- svm(y1 ~ ., data = z,type="C-classification", cross=10)
>> model
> 
> Call:
> svm(formula = y1 ~ ., data = z, type = "C-classification", cross = 10)
> 
> 
> Parameters:
>   SVM-Type:  C-classification
> SVM-Kernel:  radial
>       cost:  1
>      gamma:  0.07142857
> 
> Number of Support Vectors:  68
> 
>> pred <- predict(model,newdata=z,probability=TRUE,decision.values = TRUE)
>> table(pred)
> pred
> < 50% > 50%
>  414     0
> 
> The results of "pred" is not what I intended to get as, I expected this
> type of result:
> 
>           < 50% > 50%
> 
> < 50%    89        25
>> 50%     38        262
> 
> What should I do?
> 
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Interpreting-predictions-of-svm-tp4639405.html
> Sent from the R help mailing list archive at Nabble.com.
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list