Decision Trees (Α1) GINI(parent) = 1 - (4/10)^2 - (3/10)^2 - (3/10)^2 = 1 - 34/100 = 66/100 = 0.66 gender GINI(m) = 1 - (4/6)^2 - (1/6)^2 - (1/6)^2 = 1 - 18/36 = 0.5 GINI(f) = 1 - (0/4)^2 - (2/4)^2 - (2/4)^2 = 1 - 8/16 = 0.5 GINI(gender_split) = 6/10 * 0.5 + 4/10 * 0.5 = 0.5 car GINI(n) = 1 - (2/3)^2 - (1/3)^2 - (0/3)^2 = 1 - 5/9 = 4/9 GINI(y) = 1 - (2/7)^2 - (2/7)^2 - (3/7)^2 = 1 - 17/49 = 32/49 GINI(car_split) = 3/10 * 4/9 + 7/10 * 32/49 = 2/15 + 16/35 = 14/105 + 48/105 = 62/105 travel_cost GINI(cheap) = 1 - (4/6)^2 - (2/6)^2 - (0/6)^2 = 1 - 20/36 = 4/9 GINI(standard) = 1 - (0/1)^2 - (1/1)^2 - (0/1)^2 = 1 - 1 = 0 GINI(expensive) = 1 - (0/3)^2 - (0/3)^2 - (3/3)^2 = 1 - 1 = 0 GINI(travel_cost_split) = 6/10 * 4/9 + 1/10 * 0 + 3/10 * 0 = 4/15 income GINI(low) = 1 - (2/2)^2 - (0/2)^2 - (0/2)^2 = 0 GINI(medium) = 1 - (2/6)^2 - (3/6)^2 - (1/6)^2 = 1 - 14/36 = 11/18 GINI(high) = 1 - (0/2)^2 - (0/2)^2 - (2/2)^2 = 0 GINI(income_split) = 2/10 * 0 + 6/10 * 11/18 + 2/10 * 0 = 11/30 The smallest GINI(*_split) is 4/15, i.e., GINI(travel_cost_split). Hence GAIN(travel_cost_split) = 0.66 - 0.27 = 0.39 is the largest. (Α2) |---cheap (4/2/0) = bus | | travel_cost|---standard (0/1/0) = train | | |---expensive (0/0/3) = car Two instances are wrongly classified (in the "cheap" leaf where 2 trains are classified as buses) (Γ) The accuracy is 50%, 50% and 75% respectively.