tidymodels/bonsai

'reshape' argument to predict() will be removed in LightGBM v4.0.0

Closed this issue · 2 comments

As of microsoft/LightGBM#4971, lightgbm:::predict.lgb.Booster() no longer accepts the argument reshape. That pull request will be a part of LightGBM v4.0.0 (#34, microsoft/LightGBM#5153).

{bonsai} passes reshape = TRUE to predict.lgb.Booster() in several places.

p <- stats::predict(object$fit, prepare_df_lgbm(new_data), reshape = TRUE, ...)

stats::predict(object$fit, prepare_df_lgbm(new_data), reshape = TRUE, rawscore = TRUE, ...)

bonsai/R/lightgbm.R

Lines 304 to 311 in ad9bb39

p <-
stats::predict(
object$fit,
prepare_df_lgbm(new_data),
reshape = TRUE,
params = list(predict_disable_shape_check = TRUE),
...
)

As a result, {bonsai}'s unit tests fail against {lightgbm}'s development version (confirmed with the approach mentioned in #34 (comment)).

{bonsai}'s uses of predict.lgb.Booster(..., reshape = TRUE ...) should be removed.

I'm planning to work on this. Just wanted to document it prior to doing that.

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.