_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › SupportVectorMachines

library("kernlab")
model <- ksvm(factor(is_out) ~., data=training, kernel = "rbfdot")
pred <- predict(model, newdata=test2, type="response")             
confusionMatrix(pred, test2$is_out)     


library(e1071)
tunemodel <- tune.svm(factor(is_out) ~., data=training, gamma = 2^(-4:0), cost = 2^(-2:2))
tunemodel

model  <- svm(factor(is_out) ~ ., data = training, kernel = "radial" )
pred <- predict(model, newdata=test)
table(pred, test$is_out)

pred <- predict(model, newdata=test, probability = T)
confusionMatrix(ifelse(attr(pred, "probabilities")[,2] >= 0.7, 1, 0), test$is_out)


model <- svm(factor(is_out) ~., data=training, method="class", probability=T, class.weights=c("1"=0.45, "0"=0.55))
pred <- predict(model, newdata=test2, type="class")
confusionMatrix(pred, test2$is_out)


蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:53

る 伎 覈詩 蟆企朱 襦 蠍 伎 願 螻 襷 殊 襦 . (ろ磯 誤)