O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Choosing a correct lamda

The model output will show the ranges of lambda (the regularization parameter), which will smooth out the effects of the various coefficients to different degrees.

A plot of mod.results will display the size of the coefficients as lambda changes:

plot(mod.result,xvar="lambda")

The parameter lambda controls the amount of shrinkage for the coefficients.

Notice that as lambda gets larger, more coefficients will be shrinking towards 0:

If you print some of the results you will see how many non-zero coefficients are included in the model for each lambda, as well as the percent deviation for each model. This will help ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required