支持向量机(Support Vector Machine)
最后发布时间:2022-03-23 17:44:10
浏览量:
建模
imodel <- ksvm(group~.,
data=input)
预测
predicted <- predict(imodel,newdata = input,type="response")
error_rate <- ModelMetrics::ce(input$group,predicted)
参数筛选
svm_grid <- expand.grid(sigma=2^(-10:4),C=-5:20)
set.seed(2012)
imodel <- train(group~.,data = input,
method ="svmRadial",
preProc=c("center","scale"),tuneGrid =svm_grid )
imodel$bestTune