1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| library(caret)
library(ggplot2)
train <- data.frame("a" = rnorm(100), "b" = rnorm(100))
act <- rnorm(100)
m1 <- train(train, act, method="svmLinear")
m2 <- train(train, act, method="svmRadial")
l <- list("svmLinear" = m1, "svmRadial" = m2)
scales <- list(x=list(relation="free"), y=list(relation="free"))
bwp <- bwplot(resamples(l), scales=scales, metric=c("Rsquared", "RMSE"))
ggsave(plot = bwp, filename = "bwplot.pdf", dpi = 400, device = "pdf",
width = 300,height = 300,
units = c("mm"),limitsize = FALSE) |
Partager