oloBion / Retip

Retip - Retention Time prediction for metabolomics
31 stars 15 forks source link

Fix setting of LightGBM max_bin parameter #10

Closed ssmehta closed 1 month ago

ssmehta commented 2 years ago

As of LightGBM v3.0, the max_bin parameter is to be set in the lgb.Dataset() instead of lgb.train() and lgb.cv(). Otherwise, it fails with the error:

  [LightGBM] [Fatal] Cannot change max_bin after constructed Dataset handle.

See also: https://github.com/microsoft/LightGBM/issues/4019

kozo2 commented 2 years ago

Thanks @ssmehta I'm also in trouble with this lightgbm error.

> lightgbm <- fit.lightgbm(training,testing)
[LightGBM] [Fatal] Cannot change max_bin after constructed Dataset handle.
Error in doTryCatch(return(expr), name, parentenv, handler) : 
  Cannot change max_bin after constructed Dataset handle.
In addition: Warning message:
In lightgbm::lgb.cv(params, dtrain, nrounds = 5000, nfold = 10,  :
  lgb.cv: Found the following passed through '...': max_depth, max_leaf, max_bin. These will be used, but in future releases of lightgbm, this warning will become an error. Add these to 'params' instead. See ?lgb.cv for documentation on how to call this function.

I will try your old LightGBM environment. Thank you for your Dockerfile (and the other Docker related files) !

kozo2 commented 2 years ago

@ssmehta However, even with your Docker image, I think the following error will occur in descs <- getCD(HILIC)...

[1] "960 of 970"
[1] "961 of 970"
[1] "962 of 970"
[1] "963 of 970"
[1] "964 of 970"
[1] "965 of 970"
[1] "966 of 970"
[1] "967 of 970"
[1] "968 of 970"
[1] "969 of 970"
[1] "970 of 970"
[1] "Computing Chemical Descriptors 1 of 970 ... Please wait"
Error: segfault from C stack overflow
>

This is same with #13