tests/testthat/test-hc.R

test_that("hc bnlearn algorithm run without error and return correct classes", {
  run_all_tests(
    alg_fun = hc,
    engine = "bnlearn",
    score = "ebic_g",
    alg_args = list(
      debug = FALSE,
      restart = 10,
      perturb = 1,
      max.iter = Inf,
      maxp = Inf,
      optimized = TRUE
    ),
    suppress_warnings = TRUE
  )

  test_additional_test_or_score_args(
    alg_fun = hc,
    engine = "bnlearn",
    score = "aic_g",
    test_args = list(k = 1)
  )
})

Try the causalDisco package in your browser

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

causalDisco documentation built on April 13, 2026, 5:06 p.m.