Displaying 3 results from an estimated 3 matches for "bestc".
Did you mean:
best
2010 May 05
2
probabilities in svm output in e1071 package
svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification",
kernel="radial", cost=bestc, gamma=bestg, cross=10) # model fitting
svm.pred<-predict(svm.fit, hh, decision.values = TRUE, probability = TRUE) #
find the probability, but can not find.
attr(svm.pred, "probabilities")
> attr(svm.pred, "probabilities")
1 0
1 0 0
2 0 0
3 0 0
5 0 0
6...
2010 Jun 24
1
help in SVM
..._h)
[1] 2034 24
dim(hh) # it contains all the variables besides the variables in all_h
data set.
[1] 640 415
require(e1071)
svm.tune<-tune(svm, as.factor(out) ~ ., data=all_h,
ranges=list(gamma=2^(-5:5), cost=2^(-5:5)))# find the best parameters.
bestg<-svm.tune$best.parameters[[1]]
bestc<-svm.tune$best.parameters[[2]]
svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification",
kernel="radial", probability = TRUE, cost=bestc, gamma=bestg, cross=10) #
model fitting
svm.pred<-predict(svm.fit, hh, decision.values = TRUE, probability = TRUE) #...
2010 Apr 29
2
can not print probabilities in svm of e1071
> x <- train[,c( 2:18, 20:21, 24, 27:31)]
> y <- train$out
>
> svm.pr <- svm(x, y, probability = TRUE, method="C-classification",
kernel="radial", cost=bestc, gamma=bestg, cross=10)
>
> pred <- predict(svm.pr, valid[,c( 2:18, 20:21, 24, 27:31)],
decision.values = TRUE, probability = TRUE)
> attr(pred, "decision.values")[1:4,]
16 23 43 52
1.08157648 0.51241842 0.06234319 1.20656580
> attr...