Need help with understanding Decision Trees I am struggling to understand how decision trees work. I understand that you need to calculate the Gini coefficients for the sample features and that's how leaves are chosen.
My issue is that I don't understand how to find which leaf node corresponds to which class. Furthermore, how does this algorithm deal with multi-class classification?

The decision tree makes binary splits. Each node is an if statement, that leads you to the branch on the left, or on the right. When training the decision tree, the branching continues until hitting some stopping criterion (e.g. minimum number of samples per leaf). The final leaf is where you make the classification decision. You can either calculate the probability by looking at the empirical frequencies (3/7 samples at the leaf are cats) or make a decision (since 4/7 samples are dogs, this leaf classifies as "dog"). In multiclass classification, you just use majority vote. For regression problems, the prediction is just the mean of the leaf.
