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

Usage example causes session to abort #16

Closed
Oliver-CISC opened this issue Sep 23, 2021 · 5 comments
Closed

Usage example causes session to abort #16

Oliver-CISC opened this issue Sep 23, 2021 · 5 comments

Comments

@Oliver-CISC
Copy link

Oliver-CISC commented Sep 23, 2021

Running the following example from the README.md causes the session to abort:

library(forester)

data("titanic", package = 'DALEX')
best_model <- forester(data = titanic, target = "survived", type = "classification", metric = "precision", tune = FALSE)

Forester proceeds with the first steps creating Ranger, XgBoost, and Catboost models then aborts the session.

My sessionInfo:

R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] bit_4.0.4 odbc_1.3.2 compiler_4.1.1 ellipsis_0.3.2 generics_0.1.0 hms_1.1.0
[7] DBI_1.1.1 tools_4.1.1 Rcpp_1.0.7 bit64_4.0.5 lubridate_1.7.10 vctrs_0.3.8
[13] blob_1.2.2 lifecycle_1.0.0 pkgconfig_2.0.3 rlang_0.4.11

@Oliver-CISC
Copy link
Author

Oliver-CISC commented Sep 23, 2021

Further investigation points to the lightgbm algorithm as the culprit. All other models can be constructed using the make_ function, but make_lightgbm() immediately crashes the session.

Stepping through the code reveals lightgbm::lightgbm() to be the culprit.

@Oliver-CISC
Copy link
Author

I have found a workaround to this issue:

If you are experiencing session crashes when using forester it is likely due to the lightgbm algorithm. This can be checked by trying the individual make_ functions within forester.

The first time you try to create a forester() model it will always crash your session. In the re-started session, invoke lgb.unloader(wipe = TRUE) then proceed to run the forester() function. This should now work as expected. This problem is documented here.

@lhthien09
Copy link
Collaborator

Good morning,

Thank you for your information. We found out that the problem happened with LightGBM, as you pointed out. And in this case, LightGBM crashes with the default example sometimes; you may try this example from: https://lightgbm.readthedocs.io/en/latest/R/index.html

library(lightgbm)
data(agaricus.train, package='lightgbm')
train <- agaricus.train
dtrain <- lgb.Dataset(train$data, label = train$label)
model <- lgb.cv(
params = list(
objective = "regression"
, metric = "l2"
)
, data = dtrain
)

==> Solution is mentioned at this page: microsoft/LightGBM#3445 by restarting R session: .rs.restartR() and {forester} works.

@lhthien09
Copy link
Collaborator

image

Please feel free to report issues with {forester}, thank you once again for reporting this issue.

@Oliver-CISC
Copy link
Author

Thanks for the solution - it works reproducibly on my system!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants