Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisualisationNotYetSupportedError: get_node_criterion() is not implemented yet for LightGBM #321

Open
craftsliu opened this issue Apr 29, 2024 · 0 comments

Comments

@craftsliu
Copy link


VisualisationNotYetSupportedError Traceback (most recent call last)
/tmp/ipykernel_2428904/1600097902.py in ()
----> 1 viz_model.leaf_purity()

~/anaconda3/envs/myenv/lib/python3.8/site-packages/dtreeviz/trees.py in leaf_purity(self, display_type, colors, fontsize, fontname, grid, bins, figsize, ax)
755 :return:
756 """
--> 757 leaf_id, leaf_criteria = self.shadow_tree.get_leaf_criterion()
758
759 if display_type == "text":

~/anaconda3/envs/myenv/lib/python3.8/site-packages/dtreeviz/models/shadow_decision_tree.py in get_leaf_criterion(self)
369 For regression, supported criteria are “mse”, “friedman_mse”, “mae”.
370 """
--> 371 leaf_criterion = [(node.id, node.criterion()) for node in self.leaves]
372 x, y = zip(*leaf_criterion)
373 return np.array(x), np.array(y)

~/anaconda3/envs/myenv/lib/python3.8/site-packages/dtreeviz/models/shadow_decision_tree.py in (.0)
369 For regression, supported criteria are “mse”, “friedman_mse”, “mae”.
370 """
--> 371 leaf_criterion = [(node.id, node.criterion()) for node in self.leaves]
372 x, y = zip(*leaf_criterion)
373 return np.array(x), np.array(y)

~/anaconda3/envs/myenv/lib/python3.8/site-packages/dtreeviz/models/shadow_decision_tree.py in criterion(self)
531
532 def criterion(self):
--> 533 return self.shadow_tree.get_node_criterion(self.id)
534
535 def split_samples(self) -> Tuple[np.ndarray, np.ndarray]:

~/anaconda3/envs/myenv/lib/python3.8/site-packages/dtreeviz/models/lightgbm_decision_tree.py) in get_node_criterion(self, id)
203
204 def get_node_criterion(self, id):
--> 205 raise VisualisationNotYetSupportedError("get_node_criterion()", "LightGBM")
206
207 def get_feature_path_importance(self, node_list):

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant