Running ‘testthat.R’ [9s/15s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(bnclassify)
  > 
  > test_check("bnclassify")
  -1.54485 -1.50696 -1.31785 -1.2128 -1.4612 -1.20742 -1.26966 -1.67055 -0.440312 -1.11241 -4.29046 -4.29046 -0.545227 -0.93827 -4.23411 -4.23411
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • Local rdata file (1)
  • On CRAN (17)
  • empty test (15)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-anb-bn-operate.R:48:3): manb_arc_posterior ──────────────────────
  Error: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(a, car, smooth = 1, manb_prior = 0.1) test-anb-bn-operate.R:48:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::compute_manb_arc_posteriors(...)
   5.       └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error (test-anb-bn-operate.R:57:3): awnb weights ────────────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(a, car, smooth = 1, awnb_trees = 10) test-anb-bn-operate.R:57:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::set_weights(bn, weights)
   5.       └─base::stopifnot(...)
  ── Error (test-anb-bn.R:50:3): nominal wanbia ──────────────────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(nb("Class", v), v, smooth = 0, wanbia = TRUE) test-anb-bn.R:50:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::compute_wanbia_weights(class_var(bn), dataset = dataset)
   5.       └─stats::optim(...)
   6.         └─(function (par) ...
   7.           └─bnclassify:::fn(par, ...)
   8.             └─bnclassify:::set_weights(nb, w)
   9.               └─base::stopifnot(...)
  ── Failure (test-anb-dag.R:10:3): bnc_dag ──────────────────────────────────────
  features(bd) not identical to "B".
  names for target but not for current
  ── Failure (test-anb-dag.R:20:3): bnc_dag ──────────────────────────────────────
  features(bd) not identical to character().
  Attributes: < Modes: list, NULL >
  Attributes: < Lengths: 1, 0 >
  Attributes: < names for target but not for current >
  Attributes: < current is not list-like >
  ── Failure (test-bnc-dag-operate.R:57:3): include node nominal ─────────────────
  features(a) not equal to "safety".
  names for target but not for current
  ── Failure (test-bnc-dag-operate.R:75:3): remove feature nominal ───────────────
  features(rnb) not equal to colnames(car)[1:5].
  names for target but not for current
  ── Failure (test-bnc-dag-operate.R:99:3): feature orphans ode ──────────────────
  `o` not equal to "lug_boot".
  names for target but not for current
  ── Error (test-cv.R:98:3): cv with different parameter learning ────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(nb("class", car), car, smooth = 1, awnb_trees = 10) test-cv.R:98:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::set_weights(bn, weights)
   5.       └─base::stopifnot(...)
  ── Failure (test-graph-internal.R:16:3): get adjacent ──────────────────────────
  graph_get_adjacent("c", a) not equal to character().
  Attributes: < Modes: list, NULL >
  Attributes: < Lengths: 2, 0 >
  Attributes: < names for target but not for current >
  Attributes: < current is not list-like >
  ── Failure (test-hc-bsej.R:38:3): Excludes ─────────────────────────────────────
  features(cands[[1]]) not equal to character().
  Attributes: < Modes: list, NULL >
  Attributes: < Lengths: 1, 0 >
  Attributes: < names for target but not for current >
  Attributes: < current is not list-like >
  ── Failure (test-hc-fssj.R:32:3): includes ─────────────────────────────────────
  features(a[[1]]) not equal to "crime".
  names for target but not for current
  ── Failure (test-hc-fssj.R:33:3): includes ─────────────────────────────────────
  features(a[[2]]) not equal to "immigration".
  names for target but not for current
  ── Failure (test-learn-chowliu.R:12:3): chowliu nominal car ────────────────────
  is_perm(features(x), features) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  Backtrace:
      █
   1. └─bnclassify:::check_cl(cl, 6 + 5, "class", colnames(car)[-7]) test-learn-chowliu.R:12:2
   2.   └─testthat::expect_true(is_perm(features(x), features)) test-learn-chowliu.R:7:2
  ── Failure (test-learn-chowliu.R:17:3): chowliu nominal voting ─────────────────
  is_perm(features(x), features) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  Backtrace:
      █
   1. └─bnclassify:::check_cl(cl, 16 + 15, "Class", colnames(voting)[-17]) test-learn-chowliu.R:17:2
   2.   └─testthat::expect_true(is_perm(features(x), features)) test-learn-chowliu.R:7:2
  ── Failure (test-learn-chowliu.R:22:3): chowliu No features ────────────────────
  is_perm(features(x), features) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  Backtrace:
      █
   1. └─bnclassify:::check_cl(cl, 0, "Class", character()) test-learn-chowliu.R:22:2
   2.   └─testthat::expect_true(is_perm(features(x), features)) test-learn-chowliu.R:7:2
  ── Failure (test-learn-chowliu.R:27:3): chowliu bic car ────────────────────────
  is_perm(features(x), features) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  Backtrace:
      █
   1. └─bnclassify:::check_cl(t, 6, "class", colnames(car)[-7]) test-learn-chowliu.R:27:2
   2.   └─testthat::expect_true(is_perm(features(x), features)) test-learn-chowliu.R:7:2
  ── Failure (test-learn-chowliu.R:32:3): chowliu bic voting ─────────────────────
  is_perm(features(x), features) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  Backtrace:
      █
   1. └─bnclassify:::check_cl(t, 30, "Class", colnames(voting)[-17]) test-learn-chowliu.R:32:2
   2.   └─testthat::expect_true(is_perm(features(x), features)) test-learn-chowliu.R:7:2
  ── Error (test-learn-params-manb.R:8:3): compute manb nominal ──────────────────
  Error: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      █
   1. └─bnclassify:::compute_manb_arc_posteriors(nb, u, smooth = 1) test-learn-params-manb.R:8:2
   2.   └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error (test-learn-params-manb.R:18:3): compute manb no features ─────────────
  Error: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      █
   1. ├─testthat::expect_equivalent(...) test-learn-params-manb.R:18:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─bnclassify:::compute_manb_arc_posteriors(nb, a, smooth = 1)
   5.   └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error (test-learn-params-manb.R:24:3): compute manb prior ───────────────────
  Error: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      █
   1. └─bnclassify:::compute_manb_arc_posteriors(nb, u, smooth = 1, prior = 1e-05) test-learn-params-manb.R:24:2
   2.   └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error (test-learn-params-manb.R:44:3): compute manb smooth ──────────────────
  Error: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      █
   1. └─bnclassify:::compute_manb_arc_posteriors(nb, u, smooth = 0.99) test-learn-params-manb.R:44:2
   2.   └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error (test-learn-params-wanbia.r:6:3): make cll ────────────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─make_cll("Class", v)(w) test-learn-params-wanbia.r:6:2
   2.   └─bnclassify:::set_weights(nb, w)
   3.     └─base::stopifnot(...)
  ── Error (test-learn-params-wanbia.r:13:3): wanbia error ───────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify:::compute_wanbia_weights("Class", v, return_optim_object = TRUE) test-learn-params-wanbia.r:13:2
   2.   └─stats::optim(...)
   3.     └─(function (par) ...
   4.       └─bnclassify:::fn(par, ...)
   5.         └─bnclassify:::set_weights(nb, w)
   6.           └─base::stopifnot(...)
  ── Error (test-learn-params.R:37:3): awnb nominal ──────────────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(nb, car, smooth = 1, awnb_trees = 1, awnb_bootstrap = 1) test-learn-params.R:37:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::set_weights(bn, weights)
   5.       └─base::stopifnot(...)
  ── Error (test-learn-params.R:56:3): awnb default params ───────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(nb, car, smooth = 1, awnb_trees = 10, awnb_bootstrap = 0.5) test-learn-params.R:56:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::set_weights(bn, weights)
   5.       └─base::stopifnot(...)
  ── Error (test-learn-params.R:67:3): awnb Incomplete data ──────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(a, voting, smooth = 1, awnb_trees = 1, awnb_bootstrap = 0.1) test-learn-params.R:67:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::set_weights(bn, weights)
   5.       └─base::stopifnot(...)
  ── Error (test-learn-params.R:88:3): bnc with args and awnb ────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::bnc(...) test-learn-params.R:88:2
   2.   └─bnclassify::lp(...)
   3.     ├─bnclassify:::lp_implement(...)
   4.     └─bnclassify:::lp_implement.bnc_dag(...)
   5.       └─bnclassify:::set_weights(bn, weights)
   6.         └─base::stopifnot(...)
  ── Error (test-learn-params.R:114:3): manb nominal ─────────────────────────────
  Error: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(nb, car, smooth = 1, manb_prior = 0.5) test-learn-params.R:114:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::compute_manb_arc_posteriors(...)
   5.       └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error (test-learn-params.R:128:3): check manb predictions match wei java implementation ──
  Error: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(nb, car, smooth = 1, manb_prior = 0.5) test-learn-params.R:128:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::compute_manb_arc_posteriors(...)
   5.       └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error (test-learn-params.R:143:3): wanbia ───────────────────────────────────
  Error: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      █
   1. └─bnclassify::lp(n, v, smooth = 1, wanbia = TRUE) test-learn-params.R:143:2
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::compute_wanbia_weights(class_var(bn), dataset = dataset)
   5.       └─stats::optim(...)
   6.         └─(function (par) ...
   7.           └─bnclassify:::fn(par, ...)
   8.             └─bnclassify:::set_weights(nb, w)
   9.               └─base::stopifnot(...)
  ── Failure (test-update.R:21:3): bnc update bnc_bn with struct learning ────────
  features(b) not identical to "safety".
  names for target but not for current
  ── Failure (test-update.R:49:3): update with dag 2 ─────────────────────────────
  features(b) not identical to "safety".
  names for target but not for current
  
  [ FAIL 33 | WARN 0 | SKIP 33 | PASS 549 ]
  Error: Test failures
  Execution halted