Skip to content

Commit

Permalink
other typos
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Sep 7, 2020
1 parent 664ea85 commit 727fe46
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions R-package/R/lgb.cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ lgb.cv <- function(params = list()
params$objective <- "NONE"
}

# If loss is a single function, store it as a 1-element list
# If eval is a single function, store it as a 1-element list
# (for backwards compatibility). If it is a list of functions, store
# all of them
# all of them. This makes it possible to pass any mix of strings like "auc"
# and custom functions to eval
if (is.function(eval)) {
eval_functions <- list(eval)
}
Expand Down Expand Up @@ -586,7 +587,7 @@ lgb.merge.cv.result <- function(msg, showsd = TRUE) {
})

# Get evaluation. Just taking the first element here to
# get structture (name, higher_bettter, data_name)
# get structure (name, higher_better, data_name)
ret_eval <- msg[[1L]]

# Go through evaluation length items
Expand Down
5 changes: 3 additions & 2 deletions R-package/R/lgb.train.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@ lgb.train <- function(params = list(),
params$objective <- "NONE"
}

# If loss is a single function, store it as a 1-element list
# If eval is a single function, store it as a 1-element list
# (for backwards compatibility). If it is a list of functions, store
# all of them
# all of them. This makes it possible to pass any mix of strings like "auc"
# and custom functions to eval
if (is.function(eval)) {
eval_functions <- list(eval)
}
Expand Down
2 changes: 1 addition & 1 deletion R-package/tests/testthat/test_basic.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set.seed(708L)
# This is used to mock the situation where an evaluation
# metric increases every iteration
ACCUMULATOR_NAME <- "INCREASING_METRIC_ACUMULATOR"
assign(x = "INCREASING_METRIC_ACUMULATOR", value = 0.0, envir = .GlobalEnv)
assign(x = ACCUMULATOR_NAME, value = 0.0, envir = .GlobalEnv)

.increasing_metric <- function(preds, dtrain) {
if (!exists(ACCUMULATOR_NAME, envir = .GlobalEnv)) {
Expand Down
2 changes: 1 addition & 1 deletion R-package/tests/testthat/test_metrics.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
context(".METRICS_HIGHER_BETTER()")

test_that(".METRICS_HIGHER_BETTTER() should be well formed", {
test_that(".METRICS_HIGHER_BETTER() should be well formed", {
metrics <- .METRICS_HIGHER_BETTER()
metric_names <- names(.METRICS_HIGHER_BETTER())
# should be a logical vector
Expand Down

0 comments on commit 727fe46

Please sign in to comment.