Northeastern University R Regularization Glmnet Model and Lasso Project

User Generated

ryr10

Programming

Northeastern University

Description

Build regularization models by using Lasso(least absolute shrinkage and selection operator) .

Extend Lasso model fitting to big data that cannot be loaded into memory. You will fit solution paths for linear or logistic regression models penalized by Lasso over a grid of values for the regularization parameter lambda.

I attached an exercise, you can follow a similar format. It is easy. I also posted some code I have done so far, and after the line 9 there has shows error, your welcome to correct me. Thank you so much to work for it.

Unformatted Attachment Preview

install.packages('ncvreg') library(ncvreg) install.packages('bigmemory') library(bigmemory) install.packages('biglasso') library(biglasso) install.packages('lars') library(lars) install.packages('glmnet') library(glmnet) data(diabetes) View(diabetes) summary(x) par(mfrow=c(2,5)) for(i in 1:10){ plot(x[,i], y) abline(lm(y~x[,i])) } ols
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Please find the solution attached with R code. All the best.

Running Head: R Regularization

1

R Regularization
Name
Institutional Affiliations
Date

R Regularization

2

Outline:
R Regularization


Build regularization models by using Lasso (least absolute shrinkage and selection
operator).



Extend Lasso model fitting to big data that cannot be loaded into memory.



Fit solution paths for linear or logistic regression models penalized by Lasso over a grid
of values for the regularization parameter lambda.


Running Head: R Regularization

1

R Regularization
Name
Institutional Affiliations
Date

R Regularization

2

1. R Regularization: Introduction
In this project, the theoretical knowledge from class will be applied into technique and
skills with practical and application value in R. Majorly, the glmnet() package in R will be used
to implement LASSO function to build linear and logistic models through LASSO over values of
regularization parameter lambda. Thus, the major outcomes and activities include conducting
regularization method for models to describe relationships among variables and make useful
predictions. More specifically, this project builds regularization models by using Lasso (least
absolute shrinkage and selection operator) and further extends Lasso model fitting to big data
that cannot be loaded into memory. Finally, it fits solution paths for linear or logistic regression
models penalized by Lasso over a grid of values for the regularization parameter lambda.
The Hitters dataset in the ISLR package will be used to explore lasso penalized
regression methods. The essential libraries are installed in the next section.
Libraries
install.packages('ncvreg')
library(ncvreg)
install.packages('bigmemory')
library(bigmemory)
install.packages('biglasso')
library(biglasso)
install.packages('lars')
library(lars)
install.packages('glmnet')
library(glmnet)
install.packages('tidyverse')
library(tidyverse)

R Regularization

3

install.packages('ISLR')
library(...


Anonymous
Goes above and beyond expectations!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags