ModelOriented / treeshap

Compute SHAP values for your tree-based models using the TreeSHAP algorithm
https://modeloriented.github.io/treeshap/
GNU General Public License v3.0
78 stars 22 forks source link

missing decision types #28

Open pecto2020 opened 10 months ago

pecto2020 commented 10 months ago

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?

krzyzinskim commented 9 months ago

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.