Skip to content

Commit

Permalink
[R-package] fixed minor issues with tests and documentation (#2581)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Nov 25, 2019
1 parent 16c551c commit 102893a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R-package/R/lgb.cv.R
Expand Up @@ -360,7 +360,7 @@ lgb.cv <- function(params = list()
# Store temporarily model data elsewhere
booster_old <- list(
best_iter = fd$booster$best_iter
, best_score = fd$booster$best_score,
, best_score = fd$booster$best_score
, record_evals = fd$booster$record_evals
)
# Reload model
Expand Down
2 changes: 1 addition & 1 deletion R-package/R/lgb.prepare_rules2.R
Expand Up @@ -46,7 +46,7 @@
#' Species = c(
#' "setosa" = 3L
#' , "versicolor" = 2L
#' , virginica" = 1L
#' , "virginica" = 1L
#' )
#' )
#' newest_iris <- lgb.prepare_rules2(data = iris, rules = personal_rules)
Expand Down
1 change: 1 addition & 0 deletions R-package/R/lightgbm.R
Expand Up @@ -181,6 +181,7 @@ globalVariables(c(
"."
, ".N"
, ".SD"
, "abs_contribution"
, "Contribution"
, "Cover"
, "Feature"
Expand Down
4 changes: 2 additions & 2 deletions R-package/tests/testthat/test_parameters.R
Expand Up @@ -44,7 +44,7 @@ test_that("Feature penalties work properly", {
expect_length(var_gain[[length(var_gain)]], 0L)
})

expect_true(".PARAMETER_ALIASES() returns a named list", {
test_that(".PARAMETER_ALIASES() returns a named list", {
param_aliases <- .PARAMETER_ALIASES()
expect_true(is.list(param_aliases))
expect_true(is.character(names(param_aliases)))
Expand All @@ -55,7 +55,7 @@ expect_true(".PARAMETER_ALIASES() returns a named list", {
expect_true(is.character(param_aliases[["num_iterations"]]))
})

expect_true("training should warn if you use 'dart' boosting, specified with 'boosting' or aliases", {
test_that("training should warn if you use 'dart' boosting, specified with 'boosting' or aliases", {
for (boosting_param in .PARAMETER_ALIASES()[["boosting"]]) {
expect_warning({
result <- lightgbm(
Expand Down

0 comments on commit 102893a

Please sign in to comment.