I'm using R to make a regression tree model:
library(party)
mydata = read.csv(“data.csv”)
TreeModel = ctree(price ~., data = mydata)
I would like to extract the nodes of the tree from the root to any of the leaves. but I couldn't find any function to do that.
For example if the tree is like below:
I want to get the path from root to any leaves. So for the fist leaf from right< i want to get a path like (Koc, AirDecat, OTW, OTW, AirDecay) and for the left most leaf , it should be (Koc, AirDecay).Any hint is really appreciated.