Decision tree learning pros and cons


  • Easy to understand and interpret, perfect for visual representation. This is an example of a white box model, which closely mimics the human decision-making process.
  • Can work with numerical and categorical features.
  • Requires little data preprocessing: no need for one-hot encoding, dummy variables, and so on.
  • Non-parametric model: no assumptions about the shape of data.
  • Fast for inference.
  • Feature selection happens automatically: unimportant features will not influence the result. The presence of features that depend on each other (multicollinearity) also doesn't affect the quality.


  • It tends to overfit. This usually can be mitigated in one of three ways:
    • Limiting tree depth ...

Get Machine Learning with Swift now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.