Tuning in Decision Trees In this code, what is the [,2] column that this is referring to?
predTree <- predict(tree,BasetableVAL)[,2]
Answers and follow-up questions Answer or follow-up question 1
It is my understanding that the [,2] is referring to the probability of the response variable being 0 or 1 (i.e., the predictions of your
I hope this helps!
Answer or follow-up question 2
Just the clarify the answer by the previous poster:
If you do
you will get two columns. The first one is the probability that the instance has label 0, and the
second column is the probability that the instances has label 1.
We want the second one, and therefore we do [,2]
Michel Ballings Answer or follow-up question 3
FYI: Also this is unrelated to tuning a decision tree.
Michel BallingsSign in to be able to add an answer or mark this question as resolved.