.. _example_tree_unveil_tree_structure.py: ========================================= Understanding the decision tree structure ========================================= The decision tree structure can be analysed to gain further insight on the relation between the features and the target to predict. In this example, we show how to retrieve: - the binary tree structure; - the depth of each node and whether or not it's a leaf; - the nodes that were reached by a sample using the ``decision_path`` method; - the leaf that was reached by a sample using the apply method; - the rules that were used to predict a sample; - the decision path shared by a group of samples. **Python source code:** :download:`unveil_tree_structure.py ` .. literalinclude:: unveil_tree_structure.py :lines: 18-