tests/testthat/test-glmnet.R

test_that("glmnet + predict() works", {
  skip_on_cran()
  skip_if(do_not_run_glmnet)
  skip_if_not_installed("glmnet")
  suppressPackageStartupMessages(library(parsnip))
  model <- logistic_reg(penalty = 10, mixture = 0.1) %>%
    set_engine("glmnet") %>%
    fit(as.factor(vs) ~ ., data = mtcars)
  axed <- axe_call(model)
  expect_equal(axed$fit$call, rlang::expr(dummy_call()))
})

Try the butcher package in your browser

Any scripts or data that you put into this service are public.

butcher documentation built on June 22, 2024, 11:01 a.m.