Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205343

How to retrieve current number of leafs (or other info about tree structure) in user defined splitting functions using rpart?

$
0
0

I need to write my custom splitting function using rpart package and I found basic official guide:

https://cran.r-project.org/web/packages/rpart/vignettes/usercode.pdf

It is shown how to write splitting functions with an example of the ANOVA method. As far as I understood, those functions operates on current node level, meaning that I have an access only to a subset of training examples and I don't "see" global structure of a tree.

Does anyone know how to get e.g. number of leafs in the whole tree or mapping leaf_id -> training_example_id when tree is being built?


Viewing all articles
Browse latest Browse all 205343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>