# metaLearning_tests.R
# ::rtemis::
# 2019 Efstathios D. Gennatas MBBS AICSM PhD egenn.github.io
options(rt.font = "sans")
library(rtemis)
# Regression Data ====
x <- rnormmat(200, 2, seed = 2018)
y <- .8 * x[, 1] + x[, 2]^2 + rnorm(200)
dat <- data.frame(x, y)
res <- resample(dat, seed = 2019)
dat.train <- dat[res$Subsample_1, ]
dat.test <- dat[-res$Subsample_1, ]
# metaMod ====
if (requireNamespace("rpart", quietly = TRUE)) {
meta_glm.cart <- metaMod(dat.train, dat.test,
base.mods = c("cart", "glm"),
meta.mod = "gam")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.