I am doing past papers for my data science exam and was curious about one of the questions. They ask us to create a confusion matrix by hand for one node of a decision tree.

I understand how to create a decision tree for an entire model, but I am unsure on how to create one for just one variable. Should the entire first row be 0s other than the class A as it should always predict class A or am I missing something.

I have attached the decision tree and the exact wording of the question below. Thanks!

"(iv) Present a confusion matrix for the [leftmost terminal] node."

Decision Tree

  • $\begingroup$ If the tree had only one node, what would you do? Do same for that node, as if it is the only node $\endgroup$
    – Nikos M.
    Commented May 4, 2021 at 15:19
  • $\begingroup$ At least this is what I gather from the phrasing of the question. Unless there have been previous questions which follow another route, which would clarify this question further $\endgroup$
    – Nikos M.
    Commented May 4, 2021 at 16:01
  • $\begingroup$ I don't think the other questions are related so I believe 10xAI must be what they are asking for. Thanks! $\endgroup$ Commented May 4, 2021 at 16:53

1 Answer 1


CM is about True Vs Predicted.
Since only one node is in the discussion which means we will have only one column of "Predicted" but all the possible rows of "True"

Let's assume 100 samples in the Node. The Node must be classified as "A"
Below should be the CM - Rows are "True" and the Column is the "Predicted" \begin{array} {|r|r|} \hline &A &B &C &D &E &F \\ \hline A &62 &- &- &- &- &- \\ \hline B &21 &- &- &- &- &- \\ \hline C &13 &- &- &- &- &- \\ \hline D &00 &- &- &- &- &- \\ \hline E &02 &- &- &- &- &- \\ \hline F &02 &- &- &- &- &- \\ \hline \end{array}

  • $\begingroup$ Thanks! Glad there wasn't something I was missing :) $\endgroup$ Commented May 4, 2021 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.