tests/testthat/helper-baguette.R

library(rlang)
library(purrr)
if (is_installed("yardstick")) {
  library(yardstick)
}
if (is_installed("recipes")) {
  library(recipes)
}
if (is_installed("modeldata")) {
  data("two_class_dat", package = "modeldata")
}

# ------------------------------------------------------------------------------

num_leaves <- function(x, ...) {
  sum(x$frame$var == "<leaf>")
}

get_method <- function(x, ...) {
  x$method
}

get_loss <- function(x, ...) {
  x$parms$loss
}

Try the baguette package in your browser

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

baguette documentation built on April 4, 2025, 12:22 a.m.