1.6 Examples
First the Quick Start of R glmnet’s vignette, on R’s own data, then one section per model, then three on formulas, and one that fits the same data from every data source. Each starts from the literate program of the same name in "glmnet/examples/", whose companion under "glmnet/examples/test/" runs it and checks the result the prose promises, then goes further: it varies λ or α to show what the penalty does, and uses the family’s prediction helpers on new data.
The small fixtures of the model sections are chosen so that the right answer is known in advance: a response built from some predictors plus a column of pure noise, which a good fit should leave out. Where a section prints a sweep over λ, it rounds the numbers to three decimal places so the rows line up. The Quick Start uses R glmnet’s QuickStartExample, and the formula and data-source sections R’s mtcars and iris; their numbers are R’s.