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] lightgbm() cannot evaluate metrics on validation sets #2915

Closed
jameslamb opened this issue Mar 15, 2020 · 0 comments
Closed

[R-package] lightgbm() cannot evaluate metrics on validation sets #2915

jameslamb opened this issue Mar 15, 2020 · 0 comments

Comments

@jameslamb
Copy link
Collaborator

Evaluation on validation sets using the function lightgbm() is currently broken. The documentation suggests that you should be able to pass valids to this function similar to the way it is passed to lgb.train().

I discovered this working on #2912. As long as this bug exists, early stopping with the lightgbm() function is also broken.

Environment info

Operating System: macOS Mojave 10.14.6

CPU/GPU model: 2.3 GHz Intel Core i5

C++/Python/R version: R 3.6.1

LightGBM version or commit hash: 4aa888c

Error message

Running the code in "Reproducible examples" yields the following error:

Error in lgb.train(params = params, data = dtrain, nrounds = nrounds, :
formal argument "valids" matched by multiple actual arguments

Reproducible examples

data(agaricus.train, package = "lightgbm")
data(agaricus.test, package = "lightgbm")
train <- agaricus.train
test <- agaricus.test
dvalid1 <- lgb.Dataset(
    data = train$data
    , labels = train$label
  )
  dvalid2 <- lgb.Dataset(
    data = train$data
    , labels = train$label
  )
  nrounds <- 10L
  bst <- lightgbm(
    data = train$data
    , label = train$label
    , num_leaves = 5L
    , nrounds = nrounds
    , objective = "binary"
    , metric = "binary_error"
    , valids = list(
      "valid1" = dvalid1
      , "valid2" = dvalid2
    )
  )
@lock lock bot locked as resolved and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant