You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to create a unified lightgbm. I've fit the model using the tidymodels framework.
Unfortunately I got this error: Error in ifelse(decision_type %in% c(">=", ">"), ret.second(split_index), : Unknown decision_type. My understing is that there is a problem in decision_type. Checkig the model I've noticed that there are thousands of missing value in the decision type column...Any idea of why decisions are missing and how to solve the issue?
Missing values are expected in this column as they occur for every leaf node, so it is unlikely that this is the cause.
However, I wasn't able to reproduce this error using tidymodels framework. But please note that an object of class lgb.Booster must be provided to the lightgbm.unify function (this can be extracted with the extract_fit_engine() function, see here). If this is not the solution, please provide a reproducible example for such an error.
I get this error too and have been able to reproduce it with a toy example.
If the step_dummy() line is uncommented, then it works.
lightgbm does though support categorical data without the need to dummy these variables. This introduces the decision type == where a categorical variable equals a specific value. This may be seen in the object lgb_trees which has a column showing the decision_type used after fitting the model, e.g. for the variable neighbourhood.
Activity
krzyzinskim commentedon Sep 27, 2023
Missing values are expected in this column as they occur for every leaf node, so it is unlikely that this is the cause.
However, I wasn't able to reproduce this error using
tidymodelsframework. But please note that an object of classlgb.Boostermust be provided to thelightgbm.unifyfunction (this can be extracted with theextract_fit_engine()function, see here). If this is not the solution, please provide a reproducible example for such an error.cgoo4 commentedon Oct 1, 2024
I get this error too and have been able to reproduce it with a toy example.
If the
step_dummy()line is uncommented, then it works.lightgbm does though support categorical data without the need to dummy these variables. This introduces the decision type
==where a categorical variable equals a specific value. This may be seen in the objectlgb_treeswhich has a column showing thedecision_typeused after fitting the model, e.g. for the variableneighbourhood.Created on 2024-10-01 with reprex v2.1.1
ck37 commentedon Nov 21, 2024
I also ran into this - had to convert factors to indicators and it was resolved.
mayer79 commentedon Apr 24, 2026
Let's use @ck37 workaround, thanks.