Get startedGet started for free

Visualizing paths with decision trees

1. Visualizing paths with decision trees

Hi! Now, we'll explore decision trees and how they help us visualize decision paths, evaluate options, and support data-driven decision-making.

2. What is a decision tree?

Decision trees help structure decisions, by mapping out possible outcomes and the conditions that lead to those outcomes. Suppose you're deciding whether to go for a run or do an indoor workout. From past experience, you know that you don't like to go outside when the sun doesn't shine. You also prefer an outside temperature that isn't too cold. Based on these conditions, you know you'll only go for a run if it is both sunny and warm. Using the weather forecast, you can now plan out your workout week. A decision tree is a graphical representation of possible choices and their potential outcomes.

3. Building blocks of a decision tree

It starts with a root node. The root node represents the most important split, the variable that most clearly distinguishes the different outcomes in the data.

4. Building blocks of a decision tree

Each split creates new paths, called branches, that lead to a new decision node. Simple decision trees contain two to three new branches per decision node, but more complex trees can contain multi-way splits depending on the variable and the splitting method that is used.

5. Building blocks of a decision tree

The tree keeps splitting, until an outcome is reached. An outcome node is called a leaf node.

6. Building blocks of a decision tree

As a decision tree grows and becomes more complex, you'll be able to distinguish sub-trees. A sub-tree is a self-contained section of a decision tree that begins at a decision node and includes all of its descendant branches. It can be analyzed independently to understand the decision-making process within that localized segment, similar to how a social network might be broken down into smaller sub-networks or communities. This allows for focused analysis on specific conditions within a larger, complex system.

7. How decision trees work

Statistical software and some BI tools can calculate and visualize decisions trees for you based on patterns in the data. The software decides the best splits by finding which factor most clearly separates the data into meaningful groups. This is done using either statistical measures that measure how distinct groups are, by using if-then logic with business rules, or by using probabilities for each branch. Decision trees can be highly dependable on initial assumptions, like which features are most important, and can be prone to overfitting, which means they become too complex and won't work well with new data. For this reason, multiple decision trees are often combined into a random forest. This is a well-known machine learning technique.

8. Example: choosing the right marketing strategy

Suppose you're working for a retail company that wants to decide the best marketing strategy to increase online sales. They can choose between email marketing, social media ads, or offering discounts.

9. Example: choosing the right marketing strategy

To make the best decision, you analyze past campaign data and build a decision tree based on three key factors: customer age group, purchases in the last 6 months, and website engagement level.

10. Example: choosing the right marketing strategy

After building the tree, you can decide how to most effectively approach future customers.

11. Example: choosing the right marketing strategy

For example, a 36 year-old customer with a recent purchase is best targeted with a discount offer. This approach helps the company personalize marketing by matching customers to the most effective strategy, automating decisions and optimizing sales and marketing spend, instead of using a one-size-fits-all approach.

12. Let's practice!

Let's go hands-on with some decision trees!