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
From the course: R Essential Training Part 2: Modeling Data
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
Predicting outcomes with linear regression8m 49s
-
Predicting outcomes with lasso regression7m 48s
-
Predicting outcomes with quantile regression6m 27s
-
Predicting outcomes with logistic regression12m 49s
-
Predicting outcomes with Poisson or log-linear regression3m 43s
-
Assessing predictions with blocked-entry models10m 35s
-
-
-