SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: display mean target inner nodes [ Reply ]
By: Achim Zeileis on 2022-08-23 11:00
[forum:49434]
It is. The reason for this is simply that the terminal nodes form a non-overlapping partition that can be handled just like a factor.

However, accessing the data from the inner nodes is also provided for by the data_party() extractor. See the following post for a worked example:

https://stackoverflow.com/questions/41968910/r-extracting-inner-node-information-and-splits-from-ctree-partykit

And this post might also be relevant for what you are trying to do:

https://stackoverflow.com/questions/41290140/add-barplots-to-circles-in-inner-nodes-in-partykit-plotted-trees

RE: display mean target inner nodes [ Reply ]
By: Markus Loecher on 2022-08-23 10:44
[forum:49433]
Thanks a lot, will try this. The main challenge will be to compute the mean for the inner nodes; seems much easier to do so for the terminal nodes.

Markus

RE: display mean target inner nodes [ Reply ]
By: Achim Zeileis on 2022-08-23 09:58
[forum:49432]
Markus, you can get that to work if you:

- Compute the summary statistics you want to display in the title line for each node and format it as necessary.

- Set up a function mainlab(id, nobs) that obtains the preformatted summary by its id. (The nobs argument can then be ignored.)

For a worked example see:

https://stackoverflow.com/questions/33314187/partykit-displaying-terminal-node-percentile-values-above-terminal-node-boxplot

Best wishes,
Achim

display mean target inner nodes [ Reply ]
By: Markus Loecher on 2022-08-23 09:37
[forum:49431]
I love the way ctrees are visualized.
I know how to turn off the display of the p-value in inner nodes. Ideally I would like to replace it by a display of the mean target/output value at each inner node, would that be possible?
(At least for regression and binary classification that would be a sensible metric)

Thanks!
Markus

Thanks to:
Vienna University of Economics and Business Powered By FusionForge