context("model-performance")
data(pedis)
X_y <- prepare_X_y(data = pedis, outcome = "minor_amputation", vars = c("p", "d"))
folds <- create_folds(y = X_y$y)
fit <- train_pedis(X = X_y$X, y = X_y$y, folds = folds)
out_sample_prediction <- train_predict(folds = folds, X_y = X_y)
in_sample_prediction <- test_predict(fit)
out_sample_auc <- create_roc(out_sample_prediction)
in_sample_auc <- create_roc(in_sample_prediction)
testthat::test_that("Model fitting works", {
testthat::expect_identical(object = class(in_sample_auc), "roc")
testthat::expect_identical(object = class(out_sample_auc), "roc")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.