Every decision tree, at every node, solves this same small problem thousands of times: given one feature and a binary label, which threshold splits the data best? A tree that re-scans the array for every candidate threshold is the version that makes training slow; the one that doesn't is a running count.
Write best_split(x, y). Given a 1-D array of feature values x and a same-length 0/1 label array y, find the threshold that minimises the weighted Gini impurity of the two children it produces.
You have read the opening. The rest is free with a Bezen account, and no card is needed.
Behind the sign-in