How to interpret this decision tree? I'm building a Decision Tree on the iris dataset using R Studio. I take 100 observations as training data, and 50 as testing one. I train the tree model and plot it using these commands:
treeModel <- ctree(Species ~ ., data = trainData)
plot(treeModel)

And here is the result I got:

I have 2 questions:


*

*What is the purpose of the p-value inside each node? What is the test?

*How does it choose the split point? For example, why did it take 1.9 as a split point of Petal.Length?


Thank you so much for your help.
 A: This is mostly explained in the documentation for ctree. Type ?ctree. The most relevant part is:

Roughly, the algorithm works as follows: 1) Test the global null
  hypothesis of independence between any of the input variables and the
  response (which may be multivariate as well). Stop if this hypothesis
  cannot be rejected. Otherwise select the input variable with strongest
  association to the response. This association is measured by a p-value
  corresponding to a test for the partial null hypothesis of a single
  input variable and the response. 2) Implement a binary split in the
  selected input variable. 3) Recursively repeat steps 1) and 2).

So the independence of each variable with the class (Species) is tested. The split is made on the variable with the lowest p-value.  They are reporting the p-value so you can see how strong the association is (why that variable was chosen). Unfortunately, they do not seem to document the method used to choose the split point. However, some methods choose the splitting point that optimizes some measure of node purity after the split. For example, this paper

Usama M. Fayyad, Keki B. Irani: Multi-interval discretization of
  continuous valued attributes for classification learning. In:
  Thirteenth International Joint Conference on Artificial Intelligence,
  1022-1027, 1993.

finds the cut point that maximizes the change in entropy.
