@@ -3,6 +3,7 @@ library(dplyr)
3
3
test_that(" formula method" , {
4
4
skip_on_cran()
5
5
skip_if_not_installed(" C50" )
6
+ skip_if_not_installed(" modeldata" )
6
7
7
8
ad_data <- make_ad_data()
8
9
@@ -42,6 +43,7 @@ test_that("formula method", {
42
43
test_that(" formula method - case weights" , {
43
44
skip_on_cran()
44
45
skip_if_not_installed(" C50" )
46
+ skip_if_not_installed(" modeldata" )
45
47
46
48
ad_data <- make_ad_data()
47
49
@@ -86,6 +88,7 @@ test_that("formula method - case weights", {
86
88
test_that(" formula method - control" , {
87
89
skip_on_cran()
88
90
skip_if_not_installed(" C50" )
91
+ skip_if_not_installed(" modeldata" )
89
92
90
93
ad_data <- make_ad_data()
91
94
@@ -126,6 +129,7 @@ test_that("formula method - control", {
126
129
test_that(" non-formula method" , {
127
130
skip_on_cran()
128
131
skip_if_not_installed(" C50" )
132
+ skip_if_not_installed(" modeldata" )
129
133
130
134
ad_data <- make_ad_data()
131
135
@@ -166,6 +170,7 @@ test_that("non-formula method", {
166
170
test_that(" non-formula method - case weights" , {
167
171
skip_on_cran()
168
172
skip_if_not_installed(" C50" )
173
+ skip_if_not_installed(" modeldata" )
169
174
170
175
ad_data <- make_ad_data()
171
176
@@ -212,6 +217,7 @@ test_that("non-formula method - case weights", {
212
217
test_that(" non-formula method - control" , {
213
218
skip_on_cran()
214
219
skip_if_not_installed(" C50" )
220
+ skip_if_not_installed(" modeldata" )
215
221
216
222
ad_data <- make_ad_data()
217
223
@@ -281,6 +287,7 @@ test_that("updates", {
281
287
test_that(" mulit-predict" , {
282
288
skip_on_cran()
283
289
skip_if_not_installed(" C50" )
290
+ skip_if_not_installed(" modeldata" )
284
291
285
292
ad_data <- make_ad_data()
286
293
@@ -417,12 +424,14 @@ test_that('check_args() works', {
417
424
skip_on_cran()
418
425
skip_if_not_installed(" C50" )
419
426
skip_if_not_installed(" parsnip" , " 1.2.1.9001" )
427
+ skip_if_not_installed(" modeldata" )
428
+
420
429
ad_data <- make_ad_data()
421
430
422
431
expect_snapshot(
423
432
error = TRUE ,
424
433
{
425
- spec <- C5_rules(trees = c(1 , 2 , 3 )) %> %
434
+ spec <- C5_rules(trees = c(1 , 2 , 3 )) %> %
426
435
set_engine(" C5.0" ) %> %
427
436
set_mode(" classification" )
428
437
fit(spec , Class ~ . , data = ad_data $ ad_mod )
@@ -431,7 +440,7 @@ test_that('check_args() works', {
431
440
432
441
expect_snapshot(
433
442
{
434
- spec <- C5_rules(trees = 0 ) %> %
443
+ spec <- C5_rules(trees = 0 ) %> %
435
444
set_engine(" C5.0" ) %> %
436
445
set_mode(" classification" )
437
446
res <- fit(spec , Class ~ . , data = ad_data $ ad_mod )
@@ -440,7 +449,7 @@ test_that('check_args() works', {
440
449
441
450
expect_snapshot(
442
451
{
443
- spec <- C5_rules(trees = 1000 ) %> %
452
+ spec <- C5_rules(trees = 1000 ) %> %
444
453
set_engine(" C5.0" ) %> %
445
454
set_mode(" classification" )
446
455
res <- fit(spec , Class ~ . , data = ad_data $ ad_mod )
@@ -450,7 +459,7 @@ test_that('check_args() works', {
450
459
expect_snapshot(
451
460
error = TRUE ,
452
461
{
453
- spec <- C5_rules(min_n = c(1 , 2 , 3 )) %> %
462
+ spec <- C5_rules(min_n = c(1 , 2 , 3 )) %> %
454
463
set_engine(" C5.0" ) %> %
455
464
set_mode(" classification" )
456
465
fit(spec , Class ~ . , data = ad_data $ ad_mod )
0 commit comments