Quantcast

Interpreting predictions of svm

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Interpreting predictions of svm

Camomille
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?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Interpreting predictions of svm

Jessica Streicher
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]]
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Interpreting predictions of svm

Camomille
Jessica-

Thanks for responding quickly to me; I have fund a solution to my problem
this morning.

Kind regards,

Camille

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Loading...