5A STEP BEYOND K-NN: DECISION TREES

Image

In k-NN, we looked at the neighborhood of the data point to be predicted. Here again we will look at neighborhoods, but in a more sophisticated way. This approach will be easy to implement and explain, lends itself to nice pictures, and has more available hyperparameters with which to fine-tune it.

Here we will introduce decision trees (DTs), one of the mainstays in the ML field. Besides being used directly, DTs are also the basis for random forests and gradient boosting, which we will cover in later chapters.

5.1 Basics of Decision Trees

Though some ideas had been proposed earlier, the DT approach became widely ...

Get The Art of Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.