A tree-based method predicts by combining one or more decision trees. Each tree repeatedly splits data into more homogeneous subsets, then uses terminal leaves to produce classifications or regression predictions. section 5.1
Use the tree structure to understand the main workflow:
- Begin at the root, representing the available dataset, and test a feature condition such as a binary split. section 5.1
- Search features and observed values for splits that improve target homogeneity, using measures such as entropy, information gain, or Gini impurity. section 5.1
- Follow branches to terminal leaves, where instances receive predictions; limit growth or prune trees when a simpler structure is appropriate. section 5.1
Classifying Airbnb listings
An Airbnb NYC workflow encodes categorical columns, passes numeric columns through preprocessing, and places a DecisionTreeClassifier inside a scikit-learn pipeline evaluated with five-fold cross-validation.


