26. Model Fitting with Caret

Fitting models often involves brute-force iteration over many different values for numerous parameters and deciding upon the setting that creates the “best” model. While this could be coded from scratch, caret performs parameter tuning automatically. Additionally, it provides a standardized interface for all the models it supports, which makes the modelling process that much easier when trying multiple models.

26.1 Caret Basics

The first question a lot of people have about caret is in regard to its spelling since it is spelled like neither the vegetable nor the unit of weight. That is because caret is short for Classification And REgression Training. It is written, with great effort, primarily by Max Kuhn.

While ...

Get R for Everyone: Advanced Analytics and Graphics, 2nd Edition 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.