[MUSIC]
We've now learned decision trees from data.
Let's look at how we can make predictions from it.
So given the model that we've learned from the data, we're going to predict y hat.
As we discussed in the beginning of the module, it's a pretty simple process
of traversing down the tree in order to make that prediction.
Given that particular input xi, so going back to that first example where Credit
was poor, Income was high, and the Term was 5 years, we go down the branch of
the decision tree that is associated with those particular inputs, and
we make a prediction that y hat i is Safe.
This would be explicit,
even that prediction algorithm is what's called a recursive algorithm.
I'm trying to predict, for a particular decision tree,
I start with the top node and my input set.
And then I say, if the current node is a leaf, return,
predict whatever is on that leaf.
If it's not a leaf, then pick the child that agrees with the input and
then recurse on that child.
So return the prediction the child makes.
And then that process is going to unroll that path down the tree in order
to make the prediction.
[MUSIC]