Skip to content

Commit 040479e

Browse files
authored
Merge branch 'master' into patch-2
2 parents 246b905 + 2650321 commit 040479e

23 files changed

+27
-98
lines changed

tests/testthat/helper-objects.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
2+
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
3+
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)

tests/testthat/test_boost_tree_C50.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ library(dplyr)
66
# ------------------------------------------------------------------------------
77

88
context("boosted tree execution with C5.0")
9+
source("helper-objects.R")
910

1011
data("lending_club")
1112
lending_club <- head(lending_club, 200)
@@ -17,10 +18,6 @@ lc_basic <-
1718
boost_tree(mode = "classification") %>%
1819
set_engine("C5.0", bands = 2)
1920

20-
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
21-
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
22-
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
23-
2421
# ------------------------------------------------------------------------------
2522

2623
test_that('C5.0 execution', {

tests/testthat/test_boost_tree_spark.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ library(dplyr)
55
# ------------------------------------------------------------------------------
66

77
context("boosted tree execution with spark")
8-
9-
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
10-
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
11-
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
8+
source("helper-objects.R")
129

1310
# ------------------------------------------------------------------------------
1411

tests/testthat/test_boost_tree_xgboost.R

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@ library(parsnip)
44
# ------------------------------------------------------------------------------
55

66
context("boosted tree execution with xgboost")
7+
source("helper-objects.R")
78

89
num_pred <- names(iris)[1:4]
910

1011
iris_xgboost <-
1112
boost_tree(trees = 2, mode = "classification") %>%
1213
set_engine("xgboost")
1314

14-
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
15-
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
16-
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
17-
1815
# ------------------------------------------------------------------------------
1916

2017
test_that('xgboost execution, classification', {
@@ -101,10 +98,6 @@ bad_rf_reg <-
10198
boost_tree(mode = "regression") %>%
10299
set_engine("xgboost", sampsize = -10)
103100

104-
ctrl <- list(verbosity = 1, catch = FALSE)
105-
caught_ctrl <- list(verbosity = 1, catch = TRUE)
106-
quiet_ctrl <- list(verbosity = 0, catch = TRUE)
107-
108101
test_that('xgboost execution, regression', {
109102

110103
skip_if_not_installed("xgboost")

tests/testthat/test_linear_reg.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ library(tibble)
77

88
context("linear regression")
99
source("helpers.R")
10+
source("helper-objects.R")
1011

1112
# ------------------------------------------------------------------------------
1213

@@ -209,10 +210,6 @@ num_pred <- c("Sepal.Width", "Petal.Width", "Petal.Length")
209210
iris_bad_form <- as.formula(Species ~ term)
210211
iris_basic <- linear_reg() %>% set_engine("lm")
211212

212-
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
213-
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
214-
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
215-
216213
# ------------------------------------------------------------------------------
217214

218215
test_that('lm execution', {

tests/testthat/test_linear_reg_glmnet.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ library(tidyr)
66
# ------------------------------------------------------------------------------
77

88
context("linear regression execution with glmnet")
9+
source("helper-objects.R")
910

1011
num_pred <- c("Sepal.Width", "Petal.Width", "Petal.Length")
1112
iris_bad_form <- as.formula(Species ~ term)
@@ -14,10 +15,6 @@ iris_basic <- linear_reg(penalty = .1, mixture = .3) %>%
1415
no_lambda <- linear_reg(mixture = .3) %>%
1516
set_engine("glmnet")
1617

17-
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
18-
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
19-
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
20-
2118
# ------------------------------------------------------------------------------
2219

2320
test_that('glmnet execution', {

tests/testthat/test_linear_reg_keras.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ library(tibble)
77

88
context("keras linear regression")
99
source("helpers.R")
10+
source("helper-objects.R")
1011

1112
# ------------------------------------------------------------------------------
1213

tests/testthat/test_linear_reg_spark.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ library(dplyr)
55
# ------------------------------------------------------------------------------
66

77
context("linear regression execution with spark")
8-
9-
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
10-
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
11-
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
8+
source("helper-objects.R")
129

1310
# ------------------------------------------------------------------------------
1411

tests/testthat/test_logistic_reg.R

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ library(tibble)
77

88
context("logistic regression")
99
source("helpers.R")
10+
source("helper-objects.R")
1011

1112
# ------------------------------------------------------------------------------
1213

@@ -219,9 +220,6 @@ lending_club <- head(lending_club, 200)
219220
lc_form <- as.formula(Class ~ log(funded_amnt) + int_rate)
220221
num_pred <- c("funded_amnt", "annual_inc", "num_il_tl")
221222
lc_basic <- logistic_reg() %>% set_engine("glm")
222-
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
223-
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
224-
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
225223

226224
test_that('glm execution', {
227225

tests/testthat/test_logistic_reg_glmnet.R

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ library(tidyr)
77
# ------------------------------------------------------------------------------
88

99
context("logistic regression execution with glmnet")
10+
source("helper-objects.R")
1011

1112
data("lending_club")
1213
lending_club <- head(lending_club, 200)
@@ -15,10 +16,6 @@ num_pred <- c("funded_amnt", "annual_inc", "num_il_tl")
1516
lc_bad_form <- as.formula(funded_amnt ~ term)
1617
lc_basic <- logistic_reg() %>% set_engine("glmnet")
1718

18-
ctrl <- control_parsnip(verbosity = 1, catch = FALSE)
19-
caught_ctrl <- control_parsnip(verbosity = 1, catch = TRUE)
20-
quiet_ctrl <- control_parsnip(verbosity = 0, catch = TRUE)
21-
2219
# ------------------------------------------------------------------------------
2320

2421
test_that('glmnet execution', {

0 commit comments

Comments
 (0)