dtreeviz icon indicating copy to clipboard operation
dtreeviz copied to clipboard

Explain leaf prediction path

Open tlapusan opened this issue 2 years ago • 6 comments

Kind of similar with explain_prediction_path(x).

When looking at the tree structure (or leaf visualisations), you can observe some interesting nodes/leaves and you want to know what characteristics have all the training samples from that node. We can use the split values from the root until the interested node and build some similar output like in explain_prediction_path(x)

tlapusan avatar Mar 06 '23 10:03 tlapusan

You can use view() to show the leaf prediction path e.g viz_model.view(x=X_testset[0]) image

lchakkei avatar Mar 08 '23 13:03 lchakkei

Indeed, but it is not convenient/easy to find an x sample which belong to a specific leaf/node.

what I thought was something like 'explain_node_path(node_id=3)'

tlapusan avatar Mar 08 '23 13:03 tlapusan

I guess that makes sense to me except I'm not sure how we know what the node id is. Do we have a way to display that?

parrt avatar Mar 18 '23 18:03 parrt

I just put the mouse over a node and little pop-up appear with the node id. We could include also other info in this way.

Screenshot 2023-03-19 at 11 04 17

tlapusan avatar Mar 19 '23 09:03 tlapusan

cool! Didn't know about that. kind of like the feature earlier we talked about where in leaf display we could pop up node id in bar chart, right?

parrt avatar Mar 19 '23 18:03 parrt

yes, could be the same... but it's kind of a hidden functionality. The user has to know it upfront.

tlapusan avatar Mar 20 '23 10:03 tlapusan