I used decision trees (CART) in R, using the rpart package to look at the relationship between SST (predictor variables) and climate (predand variable).
I would like to โforceโ the tree into a specific structure, i.e. split into predictor variable 1, then into variable 2.
I used R for a while, so I thought I could look at the code behind the rpart function and change it first to look for the โbest splitsโ in a specific forecast variable first. However, the rpart function calls C-procedures and has no experience with C, I get lost here ...
I could write a function from scratch, but would like to avoid it if possible! So my questions are:
- Is there another decision tree technology (implemented in R preferably) in which you can force the tree structure?
- If not, is there a way to convert the C code to R?
- Any other ideas?
Thanks in advance and help is greatly appreciated.
source share