FLAML icon indicating copy to clipboard operation
FLAML copied to clipboard

[Bug]: Feature importances not present for an ensemble

Open lucazav opened this issue 11 months ago • 1 comments

Describe the bug

After I fit an AutoML ensemble for a regression ("ensemble": True in AutoML settings), trying to get the feature importances as follow I get an empty result:

automl.feature_importances_

As the final model is a StackRegressor, the final feature importances can be calculated by averaging the feature importances of each base estimator.

Steps to reproduce

No response

Model Used

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

FLAML 2.3.3

lucazav avatar Jan 26 '25 15:01 lucazav

Hi @lucazav , thank you for reporting this. Currently, we simply retrieve the feature_importances_ from the model, since StackingRegressor doesn't have feature_importances_, we set it to None in FLAML. I prefer wait for scikit-learn to support feature_importances_ for ensemble. WDYT? Thanks.

thinkall avatar Feb 12 '25 08:02 thinkall