test_that("multiplication works", {
expect_equal(2 * 2, 4)
})
test_that("my_knn_cv works mathematically", {
expect_equal(my_knn_cv(my_iris[, -5], my_iris$Species, 1, 2)$train_err, 0)
})
test_that("k = 0 must be at least 1", {
expect_error(my_knn_cv(my_iris[, -5], my_iris$Species, 2, 1)$train_err)
})
test_that("negative inputs not accepted", {
expect_error(my_knn_cv(my_iris[, -5], my_iris$Species, 1, -2))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.