Introduction
How does a tree decide which question to ask first, and where to put the threshold? scikit-learn uses an algorithm called CART (Classification And Regression Tree). Its strategy is simple and practical: at each step, try every possible question and keep the one that best separates the classes — then repeat for each half.
It's like organising a messy cupboard: first split everything into "kitchen" and "not kitchen" (the most useful single split), then split each pile again, and so on, without going back to reconsider the first split.