tests/testthat/test-backend_preprocessing.R

context("backend_preprocessing")

test_that(
  desc = "Test the backend_preprocessing function",
  code = {
    library(mlbench)
    data("PimaIndiansDiabetes2")
    dataset = data.table::as.data.table(PimaIndiansDiabetes2)
    target_col = "diabetes"

    backend = backend_preprocessing(
      datatable = dataset,
      target_col = target_col,
      task_type = "class:binary",
      positive = "pos"
    )

    expect_known_hash(backend, "4e34ca3afc") # d4474ab2b4
  }
)
kapsner/mlr3learners.lightgbm documentation built on Feb. 17, 2021, 5:53 p.m.