Ekeany / Boruta-Shap

A Tree based feature selection tool which combines both the Boruta feature selection algorithm with shapley values.
MIT License
559 stars 86 forks source link

Error with lightgbm regressor and importance_measure = gini [BUG] #115

Open tszyan-bain opened 1 year ago

tszyan-bain commented 1 year ago

Describe the bug

Checking the availability of feature_importance_ when importance_measure="gini" does not work for lightgbm regressor.

To Reproduce

Steps to reproduce the behavior:

  1. Initiate a lightgbm regressor and use it as the model for BorutaShap
  2. choose importance_measure = "gini"
  3. the pre-fitting check will false since before doing fitting, feature_importance_ attribute is not set in the regressor

Expected behavior

It should not raise an error.

Screenshots

Additional context

Workaround:

  1. use "shap"
  2. pre-fitting: doing a pre-fitting will expose the feature_importance_ attribute in the regressor