[R] getting probabilities from SVM

From: roger bos <roger.bos_at_gmail.com>
Date: Fri 17 Feb 2006 - 07:39:30 EST


I am using SVM to classify categorical data and I would like the probabilities instead of the classification. ?predict.svm says that its only enabled when you train the model with it enabled, so I did that, but it didn't work. I can't even get it to work with iris. The help file shows that probability = TRUE when training the model, but doesn't show an example. Then I try to predict with probabilities, I still only get classifications back. Anyone get this to work and can help me out?

Thanks,

Roger

attach(iris)

     # alternatively the traditional interface:
     x <- subset(iris, select = -Species)
     y <- Species
     model <- svm(x, y, probability = TRUE)
     pred <- predict(model, x, probability = TRUE)

	[[alternative HTML version deleted]]

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Feb 17 08:24:06 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:31 EST