For reproducing the error and what I intend to get. I have the following example. Lets say I have a datset : Iris. I am modeling a classification tree using
library(party)
ct <- ctree(Species ~ ., data = iris) #here Species is the categorical response variable
print(ct)
plot(ct)
But my question is how do i get the splitting conditions on every node , as well the terminal nodes values?
I found out using
library(partykit)
partykit:::.ctree_fit(ct)
its easy to find the split conditions. But this takes more than 8 hours for my dataset with maxdepth of tree defined to be 3.
to summarize :
- I need to find the splitting conditions for a tree using
library(party)
- Also find the values in the terminal nodes of the tree. So i can use these values in defining the rules
*Note: My dataset is little complex than the Iris data set. I have the following structure
ct <- ctree(Y ~ V1 + V2 + V3 , data= MyData,controls = ctree_control(maxdepth = 3))# here Y is factor variable , V1 & V3 is continous , V2 is categorical variable
when i do : where(ct)
i get below error
*Error :
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘where’ for signature ‘"constparty"’
Please help me in going further about this problem