From the course: R Essential Training Part 2: Modeling Data

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Predicting outcomes with lasso regression

Predicting outcomes with lasso regression

From the course: R Essential Training Part 2: Modeling Data

Start my 1-month free trial

Predicting outcomes with lasso regression

- [Instructor] When you're doing a regression model in R, you have more choices than just standard least squares linear regression. One of the more interesting alternatives, a modern development, relatively speaking is Lasso regression. And I want to show you how that works here in R. Let's start by loading a few packages including one called Lars, which stands for at least angle regression. And I'm going to load those packages and then I'm going to come down and import a new dataset, called the wine quality. And what this is, is an attempt to use the chemical properties of red wines to predict the perceived quality of them. And to import that dataset, it's nearly 1600 observations. We have 12 variables. Let's zoom in on that. So we have a number of measurements. Now I do want to point out one thing here because these variable names have spaces in them, I'll put back ticks around them. That works, I personally…

Contents