While learning about decision trees I am trying to understand the concept of decision boundary.
My tree looks like:
Then I am trying to plot the decision boundary via:
xp <- seq(0, 1, length = 100) yp <- seq(0, 1, length = 100) data2dT <- expand.grid(x1 = xp, x2 = yp) Z <- predict(tree.p, data2dT) zp.cart <- Z[,1] - Z[,2] contour(xp, yp, matrix(zp.cart, 100), add=F, levels=0, labcex=0.9, labels="", col = "green", lwd=2)
The output is:
How do I interpret this output??