Tree models

Decision trees build tree structures to generate regression or classification models. You can think of it as a collection of chained if, and else if statements that will culminate in predictions. These models are very flexible:

  • Categorical and numerical input/output is welcomed
  • Classifications and regressions can be made using tree-based models
  • Trees can grow very long (and complicated) or small (and simple)
Although it's possible to design very complicated trees, it is not recommended to do so. Over-complicated trees tend to be a great source of overfitting.

Needless to say, it is very easy to implement tree-based models with R. Even more complex algorithms that rely on trees as basic building blocks can be easily implemented ...

Get Hands-On Data Science with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.