XAI applied to an autopilot decision tree
In this section, we will explain decision trees through scikit-learn's tree
module, the decision tree classifier's parameters, and decision tree graphs. The goal is to provide the user with a step-by-step method to explain decision trees.
We will begin by parsing the structure of a decision tree.
Structure of a decision tree
The structure of a decision tree provides precious information for XAI. However, the default values of the decision tree classifier produce confusing outputs. We will first generate a decision tree structure with the default values. Then, we will use a what-if approach that will prepare us for the XAI tools in Chapter 5, Building an Explainable AI Solution from Scratch.
Let's start by implementing the default decision tree structure's output.
The default output of the default structure of a decision tree
The decision tree estimator contains a tree_
object that stores the...