Decision Path

noun

say it: “dih-SIZH-un PATH” /dɪˈsɪʒən ˈpæθ/

In a decision tree, the series of questions and answers that leads one example from the first question to its final answer.

What is a decision path in a decision tree?

A decision path is the chain of questions one example answers on its way down a decision tree, from the top question to the leaf that gives its answer, such as "over 157.5 grams? no; red? yes: apple". Reading it explains that one guess; scikit-learn's decision_path() lists the nodes it passed.

from sklearn.tree import DecisionTreeClassifier
fruit = [[120, 1], [130, 1], [125, 0], [135, 0], [180, 0], [185, 0], [190, 0]]   # grams, red (1) or not
names = ["apple", "apple", "lemon", "lemon", "orange", "orange", "orange"]
tree = DecisionTreeClassifier(random_state=0).fit(fruit, names)
print(tree.decision_path([[128, 1]]).indices)   # [0 1 3]: grams?, then red?, then the apple leaf

In a sentence

  • “Reading a loan's decision path showed which answers led to the refusal.”
  • “The fruit's decision path went left at 'over 157.5 grams', right at 'red' and ended at 'apple'.”

Level: Journeyman · More AI Basics terms at this level

Updated