library(testthat)
context("Test the output of lm_ridge_lambda_best function.")
test_that("Your lm_ridge_lambda_best() function can choose the best lambda.",
{
data(iris)
best_lambda_self_defined <- lm_ridge_lambda_best(Sepal.Width~., iris)
best_lambda_by_glmnet <- glmnet_ridge_lambda_best(Sepal.Width~., iris)
expect_equivalent(best_lambda_self_defined, best_lambda_by_glmnet,tolerance = 1e-2)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.