Chapter 12. Model Tuning and the Dangers of Overfitting
In order to use a model for prediction, the parameters for that model must be estimated. Some of these parameters can be estimated directly from the training data, but other parameters, called tuning parameters or hyperparameters, must be specified ahead of time and canât be directly found from training data. These are unknown structural values or other kinds of values that have significant impact on the model but cannot be directly estimated from the data. This chapter will provide examples of tuning parameters and show how we use the tidymodels functions to create and handle tuning parameters. Weâll also demonstrate how poor choices of these values lead to overfitting and introduce several tactics for finding optimal tuning parameters values. Chapters 13 and 14 go into more detail on specific optimization methods for tuning.
Model Parameters
In ordinary linear regression, there are two parameters and of the model:
When we have the outcome () and predictor () data, we can estimate the two parameters and :
and
We can directly estimate these values from the data for this example model because they are analytically tractable; if we have the data, then we can estimate these model parameters.
Note
There are many situations where a model has parameters ...
Get Tidy Modeling 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.