Skip to content

Commit 2a38bea

Browse files
committed
small tweaks to reduce verbosity.
1 parent c872c42 commit 2a38bea

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

R/lightgbm.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ train_lightgbm <- function(x, y, max_depth = 17, num_iterations = 10, learning_r
272272
data = prepare_df_lgbm(x),
273273
label = y,
274274
categorical_feature = categorical_columns(x),
275-
feature_pre_filter = FALSE
275+
params = list(feature_pre_filter = FALSE)
276276
)
277277

278278
main_args <- list(
@@ -345,7 +345,8 @@ predict_lightgbm_classification_raw <- function(object, new_data, ...) {
345345
#' @export
346346
predict_lightgbm_regression_numeric <- function(object, new_data, ...) {
347347
# train_colnames <- object$fit$.__enclos_env__$private$train_set$get_colnames()
348-
p <- stats::predict(object$fit, prepare_df_lgbm(new_data), reshape = TRUE, predict_disable_shape_check=TRUE, ...)
348+
p <- stats::predict(object$fit, prepare_df_lgbm(new_data), reshape = TRUE,
349+
params = list(predict_disable_shape_check=TRUE), ...)
349350
p
350351
}
351352

tests/testthat/helper-model.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mtcars_class_binary$vs <- as.factor(mtcars$vs)
55

66
expect_all_modes_works <- function(model, engine) {
77
if(engine == "lightgbm") {
8-
model <- parsnip::set_engine(model, engine, verbosity = -1L)
8+
model <- parsnip::set_engine(model, engine, verbose = -1L)
99
} else {
1010
model <- parsnip::set_engine(model, engine)
1111
}

tests/testthat/test-lightgbm.R

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
test_that("simple test", {
2-
3-
library(lightgbm)
4-
data(agaricus.train, package='lightgbm')
5-
train <- agaricus.train
6-
dtrain <- lgb.Dataset(train$data, label = train$label)
7-
model <- lgb.cv(
8-
params = list(
9-
objective = "regression"
10-
, metric = "l2"
11-
)
12-
, data = dtrain
13-
)
14-
15-
expect_s3_class(model, "lgb.CVBooster")
16-
})
17-
181
test_that("lightgbm", {
192

203
model <- parsnip::boost_tree(mtry = 1, trees = 50, tree_depth = 15, min_n = 1)

0 commit comments

Comments
 (0)