Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R-package] fixed minor issues with tests and documentation #2581

Merged
merged 1 commit into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion R-package/R/lgb.cv.R
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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