# Iterative Oblique Decision Trees Deliver Explainable RL Models
## 4 Results
### Explainability for Oblique Decision Trees in RL
#### 4.4.2 Distance to Hyperplanes  
Further insights that help to explain a DT can be gained by visualizing the distance to hyperplanes of the nodes of a DT. According to Equation (1), each split node has an associated hyperplane in the observation space so that observations above or below this hyperplane take a route to different subtrees (or leaves) of this node. Although hyperplanes in higher dimensions are difficult to visualize and interpret, the distance to each hyperplane is easy to visualize, regardless of the dimension of the observation space. It can be shown that even an anisotropic scaling of the observation space leaves the relations between all distances to a particular hyperplane intact, i.e., they are changed only by a common factor (see Appendix B). Figure 7 shows the distance plots for the three nodes \(0,1,2\) of the ITER OPCT for Lunarlander. A distance plot shows the distances of the observations to the node's hyperplane for a specific episode as a function of time step \(t\). Each observation is colored by the action the DT has taken. It is seen in Figure 7 that after a short transient period \begin{table}
\begin{tabular}{l c c c c c} \hline \hline  & & & \multicolumn{3}{c}{**Number of Parameters**} \\
**Environment** & **Dim**\(D\) & **Model** & **Oracle** & **ITER** & **Depth**\(d\) \\ \hline Acrobot-v1 & 6 & DQN & 136,710 & 9 & 1 \\ CartPole-v1 & 4 & PPO & 9155 & 7 & 1 \\ CartPole-SwingUp-v1 & 5 & DQN & 534,534 & 890 & 7 \\ Lunarlander-v2 & 8 & PPO & 9797 & 31 & 2 \\ MountainCar-v0 & 2 & DQN & 134,656 & 5 & 1 \\ MountainCarContinuous-v0 & 2 & TD3 & 732,406 & 5 & 1 \\ Pendulum-v1 & 3 & TD3 & 734,806 & 156 & 5 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Oracle and tree complexity. (\(D\) denotes the dimension of the observation space. )(\(t\leq 40\)), the distances for every node stay small while the lander sinks. At about time step \(t\approx 280\), the lander touches the ground and the distances increase (because all velocities are forced to be zero, all positions and angles are forced to certain values prescribed by the shape of the ground), which is, however, irrelevant for the control of the lander and the success of the episode. All nodes are attracting nodes (points are attracted to the respective hyperplane), which bring the ship to an equilibrium (a sinking position with constant \(v_{y}\)) that guarantees a safe landing. Another example is shown in Figure 8 for the three nodes \(0,1,2\) of the ITER OPCT for Pendulum. These are the three upper nodes of a tree with depth 3 and, therefore, seven split nodes. Node 0 is an attracting one (\"equilibrium node\") because the distances approach zero (here: for \(t\geq 64\)). Nodes 1 and 2 do not exhibit a zero distance in the equilibrium state; instead, they are \"swing-up nodes\" responsible for bringing energy into the system through appropriate action switching. Figure 7: Distance to hyperplanes for Lunarlander. The diagrams show root node, left child, and right child from top to bottom. Small points: node is “inactive” for this observation (the observation is not routed through this node). Big points: node is “active”. The lower left plot (\"distance to equilibrium\") of Figure 8 shows the distance of each observation to the unstable equilibrium point \((\cos\theta,\sin\theta,\omega)=(1,0,0)\) (the desired goal state). Interestingly, at \(t=64\) (vertical gray line), where the distance to node 0 is already close to zero, the distance to the equilibrium point is not yet zero (but soon will be). This is because the hyperplane is oriented in such a way that for small angle \(\theta\), the angular velocity \(\omega\) is approximately \(\omega=-5.3\sin(\theta)\) (read off from the node's parameters). The hyperplane tells us on which path the pole approaches the equilibrium point. The control strategy is to raise \(\omega\) for points below the hyperplane and to lower \(\omega\) for points above.