Page 1 of 1

[python] Q1. Randomly divide the Boston dataset into 2 parts according to the ratio 70:30 and do the following requireme

Posted: Mon Apr 11, 2022 6:27 am
by answerhappygod
[python]
Q1. Randomly divide the Boston dataset into 2 parts according to
the ratio 70:30 and do the following requirements:
a) Build a Lasso regression model (using the 70% data) with
different lambda values ​​and calculate the corresponding MSE test
value for each of these lambda values ​​(using the 30% data)
b) Draw a graph showing the variation of the regression
coefficients of the Lasso model according to the values ​​of the
lambda;
c) Graph showing the variation of MSE test value against lambda
values;
d) Determine the lambda value corresponding to the smallest MSE
test value;
e) Use the above lambda value to build a new Lasso regression model
using all rows in the dataset. Present the regression coefficients
of this Lasso model.
Q2. You build a Lasso regression model of the variable "crim"
with other variables. However, you determine the value of the
lambda by the 10-folds cross-validation method. Use this lambda
value to build a new Lasso regression model using all rows in the
dataset.
What do you think about the method of 2 methods?