January 2018
Beginner to intermediate
422 pages
9h 47m
English
The last type of regularization method that we will analyze is ElasticNet; it is a hybrid of both Lasso and Ridge regression. It is trained with both L1-norm and L2-norm prior as regularizer. A practical advantage of trading off between Lasso and Ridge is that it allows ElasticNet to inherit some of Ridge's stability under rotation. To analyze a practical case of this method, we will use the dataset already used in the Ridge and Lasso regression.
Let's start by loading the Seatbelts dataset through the following command:
Seatbelts <- data.frame(Seatbelts)
As already done before, we will split the dataset into two (before/after the law):
BeforeLaw <-subset(Seatbelts,law ==0)AfterLaw <- subset(Seatbelts,law!=0)
To perform ...
Read now
Unlock full access