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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply