Nothing
library(testthat)
library(caret)
library(themis)
context('upsampling with recipes')
# ------------------------------------------------------------------------------
set.seed(2542)
dat <- twoClassSim(200, intercept = 6)
# ------------------------------------------------------------------------------
rec <-
recipe(Class ~ TwoFactor1 + TwoFactor2 + Linear01, data = dat) %>%
themis::step_upsample(Class, seed = 534)
test_that("model test", {
mod <- train(rec, dat, method = "knn", trControl = trainControl(method = "cv"))
expect_equivalent(
rep(max(table(dat$Class)), 2),
as.vector(table(mod$finalModel$learn$y))
)
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.