modeva.TestSuite.interpret_local_tree#
- TestSuite.interpret_local_tree(dataset: str = 'test', sample_index: int = 0)#
Generate a visualization of the decision path for a specific sample through the decision tree.
This method creates a tree diagram highlighting the specific nodes and path traversed when classifying/predicting a single sample.
- Parameters:
dataset ({"main", "train", "test"}, default="test") – The data set used for calculating the explanation results.
sample_index (int, default=0) – The index of the sample in the selected dataset to visualize the decision path for.
- Returns:
A result object containing:
key: “interpret_tree_local”
data: Name of the dataset used
model: Name of the model used
inputs: Input parameters
options: Dictionary of visualizations configuration for the local tree diagram. Run results.plot() to show this plot.
- Return type:
Examples