O'Reilly logo

Principles of Data Science by Sinan Ozdemir

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Decision trees

Decision trees are supervised models that can either preform regression or classification.

Let's take a look at some major league baseball player data from 1986-1987. Each dot represents a single player in the league:

  • Years (x axis): Number of years played in the major leagues
  • Hits (y axis): Number of hits the player had in the previous year
  • Salary (color): Low salary is blue/green, high salary is red/yellow
Decision trees

The preceding data is our training data. The idea is to build a model that predicts the salary of future players based on Years and Hits. A decision tree aims to make splits on our data in order to segment the data points that act ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required