Decision Trees — A Bird’s eye view and an Implementation

Vishal R
Towards Data Science
1 min readAug 27, 2018

--

This article is being moved to my Substack Publication. You can read the article for free here. This post will be deleted on 18th May 2022.

What is achieved in this article?

The following are achieved in this dataset

  • Understanding the definition of Decision Trees

Implementation

  • Loading the data
  • Visualizing the data using a correlation matrix and a pair plot
  • Building a Decision Tree Classifier
  • Determining the accuracy of the model using a confusion matrix
  • Visualizing the Decision tree as a flow chart

What are Decision Trees?

A decision tree is a flowchart-like structure in which each internal node represents a “test” on an attribute (e.g. whether a coin flip comes up heads or tails), each branch represents the outcome of the test, and each leaf node represents a class label (decision taken after computing all attributes).

(Source: Wikipedia)

In simpler terms, a decision tree checks if an attribute or a set of attributes satisfy a condition and based on the result of the check, the subsequent checks are performed. The tree splits the data into different parts based these checks.

Implementation

The rest of this article has been moved to the publication Machine Learning — The Science, The Engineering, and The Ops. You can read the entire article for free here.

--

--

Data Scientist at Freshworks. Likes to talk about Machine Learning and plays the Harmonica. Slowly moving to Substack