Assign3 Lasso
Assign3 Lasso
In this study, we consider a dataset of claim sizes (severities) from Allstate. The data set has 130 features
and we are uncertain about what the features represent. Hence, the regression models in this study are purely
based on shrinkage and selection techniques.
Since the data is large (188,318 records and 130 features) we chose a training data that conists of 20% of
the data to keep runtimes manageable. We want to develop models to predict loss. The most basic candidate
for predictive modeling: linear regression is first used. This OLS model is regressed on all the 130 features
and is compared to the LASSO regression model later in this report.
We try to use LASSO regression using glmnet for our predictive modeling purposes. Given the size of
our model, LASSO regression helps in selection as well as shrinkage. For the LASSO model, there is a
penalty term which is weighed by a tuning parameter, Figure 1 visualizes the relationship between
feature coefficients and . It should be noted that when there are large s, the feature coefficients are
essentially set to zero. We must reach a compromise where the feature coefficients and value makes the
most sense.
Figure 2. Mean-squared-error of the test and train sets as a function of the model complexity.
Furthermore, Figure 3 compares the relationship between Mean-squared error and l. It is clear that the
mean-squared error increases exponentially as log () goes beyond 4. In order to tune our parameter , we
use the cross-validation technique with 5 folds. With this technique we get a minimum =1.285.