IQVIA-ML / LightGBM.jl

Julia FFI interface to Microsoft's LightGBM package
Other
93 stars 10 forks source link

`num_threads` for `predict` #135

Closed artemsolod closed 1 year ago

artemsolod commented 1 year ago

predict by default reuses num_threads from training. However LightGBM supports setting a separate num_threads for predict. Here is a python example https://github.com/microsoft/LightGBM/issues/4706.

I am not familiar with MLJ interface so I have added a num_threads keyword argument only to predict and predict_classes.

Also some of the test are failing but it appears to be unrelated to this PR (KeyError: key "LIGHTGBM_EXAMPLES_PATH" not found)

kainkad commented 1 year ago

Hi @artemsolod thanks for the PR and adding num_threads to predict. The CI tests passed and the KeyError you observed is because locally you need to download and extract the LightGBM examples and then set the environment variable LIGHTGBM_EXAMPLES_PATH to the root of the source installation so it can use these examples for tests. It would be great to add a basic test for LGBM_BoosterPredictForMat but I'll leave it up to you. There's a small comment on the PR.

artemsolod commented 1 year ago

Thanks for the comments @kainkad! I've added a simple test call for LGBM_BoosterPredictForMat, hope it's enough, as I see there are other tests on predict that use it internally.

kainkad commented 1 year ago

Thanks for the comments @kainkad! I've added a simple test call for LGBM_BoosterPredictForMat, hope it's enough, as I see there are other tests on predict that use it internally.

Sounds good!