Running ‘testthat.R’ [9s/13s]
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
  [ FAIL 32 | WARN 0 | SKIP 38 | PASS 533 ]
  
  ══ Skipped tests (38) ══════════════════════════════════════════════════════════
  • Local rdata file (1): 'test-infer-anb-cpp.R:48:2'
  • On CRAN (17): 'test-cv.R:65:3', 'test-cv.R:75:3', 'test-cv.R:85:3',
    'test-cv.R:107:3', 'test-cv.R:117:3', 'test-cv.R:188:3',
    'test-learn-params-wanbia.r:20:3', 'test-learn-params-wanbia.r:29:3',
    'test-learn-params-wanbia.r:39:3', 'test-learn-struct.R:20:3',
    'test-learn-struct.R:32:3', 'test-learn-struct.R:50:3',
    'test-learn-struct.R:59:3', 'test-learn-struct.R:70:3',
    'test-wrap-mlr.R:4:3', 'test-wrap-mlr.R:19:3', 'test-wrap-mlr.R:41:3'
  • empty test (19): 'test-anb-families.R:21:1', 'test-basic-assert.R:3:1',
    'test-cpp-table.R:18:1', 'test-cpp-table.R:28:1', 'test-cpp-table.R:39:1',
    'test-cpp-table.R:44:1', 'test-cpp-table.R:62:1', 'test-cv.R:148:1',
    'test-infer-anb-cpp.R:31:1', 'test-infer-anb.R:37:1', 'test-infer.R:16:1',
    'test-infer.R:61:1', 'test-infer.R:105:1', 'test-learn-aode.r:50:1',
    'test-learn-aode.r:82:1', 'test-predict.R:3:1', 'test-update.R:61:1',
    'test-wrap-grain.R:3:1', 'test-wrap-grain.R:14:1'
  • gRain has removed the predict function (1): 'test-wrap-grain.R:28:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-anb-bn-operate.R:48:3'): manb_arc_posterior ────────────────────
  Error in `compute_manb_arc_posteriors(x, ctgts = ctgts, smooth = smooth, 
      prior = manb_prior)`: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(a, car, smooth = 1, manb_prior = 0.1) at test-anb-bn-operate.R:48:3
   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 in `set_weights(bn, weights)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(a, car, smooth = 1, awnb_trees = 10) at test-anb-bn-operate.R:57:3
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::set_weights(bn, weights)
   5.       └─base::stopifnot(...)
  ── Error ('test-anb-bn.R:47:3'): nominal wanbia ────────────────────────────────
  Error in `set_weights(nb, w)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(nb("Class", v), v, smooth = 0, wanbia = TRUE) at test-anb-bn.R:47:3
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::compute_wanbia_weights(class_var(bn), dataset = dataset)
   5.       └─stats::optim(...)
   6.         └─stats (local) `<fn>`(`<dbl>`)
   7.           └─bnclassify (local) 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 in `set_weights(bn, weights)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(nb("class", car), car, smooth = 1, awnb_trees = 10) at test-cv.R:98:3
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::set_weights(bn, weights)
   5.       └─base::stopifnot(...)
  ── 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 (local) check_cl(cl, 6 + 5, "class", colnames(car)[-7]) at test-learn-chowliu.R:12:3
   2.   └─testthat::expect_true(is_perm(features(x), features)) at test-learn-chowliu.R:7:3
  ── 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 (local) check_cl(cl, 16 + 15, "Class", colnames(voting)[-17]) at test-learn-chowliu.R:17:3
   2.   └─testthat::expect_true(is_perm(features(x), features)) at test-learn-chowliu.R:7:3
  ── 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 (local) check_cl(cl, 0, "Class", character()) at test-learn-chowliu.R:22:3
   2.   └─testthat::expect_true(is_perm(features(x), features)) at test-learn-chowliu.R:7:3
  ── 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 (local) check_cl(t, 6, "class", colnames(car)[-7]) at test-learn-chowliu.R:27:3
   2.   └─testthat::expect_true(is_perm(features(x), features)) at test-learn-chowliu.R:7:3
  ── 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 (local) check_cl(t, 30, "Class", colnames(voting)[-17]) at test-learn-chowliu.R:32:3
   2.   └─testthat::expect_true(is_perm(features(x), features)) at test-learn-chowliu.R:7:3
  ── Error ('test-learn-params-manb.R:8:3'): compute manb nominal ────────────────
  Error in `compute_manb_arc_posteriors(nb, u, smooth = 1)`: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify:::compute_manb_arc_posteriors(nb, u, smooth = 1) at test-learn-params-manb.R:8:3
   2.   └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error ('test-learn-params-manb.R:18:3'): compute manb no features ───────────
  Error in `compute_manb_arc_posteriors(nb, a, smooth = 1)`: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      ▆
   1. ├─testthat::expect_equivalent(...) at test-learn-params-manb.R:18:3
   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 in `compute_manb_arc_posteriors(nb, u, smooth = 1, prior = 1e-05)`: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify:::compute_manb_arc_posteriors(nb, u, smooth = 1, prior = 1e-05) at test-learn-params-manb.R:24:3
   2.   └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error ('test-learn-params-manb.R:44:3'): compute manb smooth ────────────────
  Error in `compute_manb_arc_posteriors(nb, u, smooth = 0.99)`: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify:::compute_manb_arc_posteriors(nb, u, smooth = 0.99) at test-learn-params-manb.R:44:3
   2.   └─base::stopifnot(identical(features(x), names(ctgts)))
  ── Error ('test-learn-params-wanbia.r:6:3'): make cll ──────────────────────────
  Error in `set_weights(nb, w)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─make_cll("Class", v)(w) at test-learn-params-wanbia.r:6:3
   2.   └─bnclassify:::set_weights(nb, w)
   3.     └─base::stopifnot(...)
  ── Error ('test-learn-params-wanbia.r:13:3'): wanbia error ─────────────────────
  Error in `set_weights(nb, w)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify:::compute_wanbia_weights("Class", v, return_optim_object = TRUE) at test-learn-params-wanbia.r:13:3
   2.   └─stats::optim(...)
   3.     └─stats (local) `<fn>`(`<dbl>`)
   4.       └─bnclassify (local) fn(par, ...)
   5.         └─bnclassify:::set_weights(nb, w)
   6.           └─base::stopifnot(...)
  ── Error ('test-learn-params.R:37:3'): awnb nominal ────────────────────────────
  Error in `set_weights(bn, weights)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(nb, car, smooth = 1, awnb_trees = 1, awnb_bootstrap = 1) at test-learn-params.R:37:3
   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 in `set_weights(bn, weights)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(nb, car, smooth = 1, awnb_trees = 10, awnb_bootstrap = 0.5) at test-learn-params.R:56:3
   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 in `set_weights(bn, weights)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(a, voting, smooth = 1, awnb_trees = 1, awnb_bootstrap = 0.1) at test-learn-params.R:67:3
   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 in `set_weights(bn, weights)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::bnc(...) at test-learn-params.R:88:3
   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 in `compute_manb_arc_posteriors(x, ctgts = ctgts, smooth = smooth, 
      prior = manb_prior)`: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(nb, car, smooth = 1, manb_prior = 0.5) at test-learn-params.R:114:3
   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 in `compute_manb_arc_posteriors(x, ctgts = ctgts, smooth = smooth, 
      prior = manb_prior)`: identical(features(x), names(ctgts)) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(nb, car, smooth = 1, manb_prior = 0.5) at test-learn-params.R:128:3
   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 in `set_weights(nb, w)`: identical(sort(feats), sort(features(bn))) is not TRUE
  Backtrace:
      ▆
   1. └─bnclassify::lp(n, v, smooth = 1, wanbia = TRUE) at test-learn-params.R:143:3
   2.   ├─bnclassify:::lp_implement(...)
   3.   └─bnclassify:::lp_implement.bnc_dag(...)
   4.     └─bnclassify:::compute_wanbia_weights(class_var(bn), dataset = dataset)
   5.       └─stats::optim(...)
   6.         └─stats (local) `<fn>`(`<dbl>`)
   7.           └─bnclassify (local) 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 32 | WARN 0 | SKIP 38 | PASS 533 ]
  Error: Test failures
  Execution halted