library(caret)
# 定义自定义网格
customGrid <- expand.grid(C = seq(0.1, 10, by = 0.1))
# 训练模型时使用自定义网格
fitControl <- trainControl(method = "cv")
svmFit <- train(your_data, your_response, method = "svmRadial",
trControl = fitControl, tuneGrid = customGrid)
# 打印训练模型的摘要
print(svmFit)