parrt / dtreeviz

A python library for decision tree visualization and model interpretation.
MIT License
2.89k stars 332 forks source link

VisualisationNotYetSupportedError: get_feature_path_importance() is not implemented yet for LightGBM #322

Open craftsliu opened 2 months ago

craftsliu commented 2 months ago

VisualisationNotYetSupportedError Traceback (most recent call last) /tmp/ipykernel_2428904/313717705.py in () ----> 1 viz_model.instance_feature_importance(x)

~/anaconda3/envs/myenv/lib/python3.8/site-packages/dtreeviz/trees.py) in instance_feature_importance(self, x, colors, fontsize, fontname, grid, figsize, ax) 841 :param ax: optional matplotlib "axes" to draw into 842 """ --> 843 explain_prediction_sklearn_default(self.shadow_tree, x, 844 colors, 845 fontsize,

~/anaconda3/envs/myenv/lib/python3.8/site-packages/dtreeviz/interpretation.py) in explain_prediction_sklearn_default(shadow_tree, x, colors, fontsize, fontname, grid, figsize, ax) 123 decision_node_path = [node.id for node in decision_node_path] 124 --> 125 feature_path_importance = shadow_tree.get_feature_path_importance(decision_node_path) 126 127 colors = adjust_colors(colors)

~/anaconda3/envs/myenv/lib/python3.8/site-packages/dtreeviz/models/lightgbm_decision_tree.py) in get_feature_path_importance(self, node_list) 206 207 def get_feature_path_importance(self, node_list): --> 208 raise VisualisationNotYetSupportedError("get_feature_path_importance()", "LightGBM") 209 210 def get_max_depth(self) -> int:

VisualisationNotYetSupportedError: get_feature_path_importance() is not implemented yet for LightGBM. Please create an issue on https://github.com/parrt/dtreeviz/issues if you need this. Thanks!