-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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] lgb.Dataset with free_raw_data = FALSE still raises an error #6008
Comments
Thanks for using LightGBM and for the clear writeup with a reproducible example! I've edited the text a bit to make it clearer which parts are your own words, logs printed by LightGBM, and the code you ran. If you're unfamiliar with how to do that, please see https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax. I'll investigate this today. |
I ran this code on
That looks like a bug to me. Maybe because the raw data isn't being passed through in LightGBM/R-package/R/lgb.Dataset.R Lines 561 to 565 in 20975ba
Sorry about that! Are you interested in trying to contribute a fix? If not, someone here will pick it up when we have time. |
I opened a PR for this as a possible fix. I reproduced this using the library(lightgbm)
boston = MASS::Boston
str(boston)
dim(boston)
set.seed(12)
boston_lgb_dataset = lgb.Dataset(scale(boston[, -14]), label = boston[, 14] ,free_raw_data = FALSE)
dtrain = lgb.slice.Dataset(boston_lgb_dataset, c(1:350))
dtest = lgb.slice.Dataset(boston_lgb_dataset, c(351:506))
params = list(
objective = "regression"
, metric = "l2"
, min_data = 1L
, learning_rate = .3
)
model = lgb.train(
params = params
, data = dtrain
, nrounds = 20L
, valids = list( test = dtest)
) |
Description
Defining a lgb.Dataset with free_raw_data = FALSE. Then slicing it in two parts and using them as train/validation sets in lightgbm (R). The call
lgb.train(...
fails with an errorDon't understand why. Can anyone help please?
Reproducible example
Environment info
R version 4.2.0
LightGBM version: 3.3.5
The text was updated successfully, but these errors were encountered: