Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SOLVE BY PYTHON PLEASE SSOLVE BY PYTHON feature_1 feature_2 feature_3 feature_4 feature_5 feature_6 response 125 256 6000 256.1 16 128 198 0 1 29 8000
SOLVE BY PYTHON PLEASE
SSOLVE BY PYTHON
feature_1 feature_2 feature_3 feature_4 feature_5 feature_6 response 125 256 6000 256.1 16 128 198 0 1 29 8000 32000 32.0 8 32 269 2 29 8000 32000 32.0 8 32 220 3 29 8000 32000 32.0 8 32 172 4 29 8000 16000 32.0 8 16 132 B1. [3 Marks] Do the following: 1. [1] Display "feature_1' column and 'response' column in the transposed format. That is, the table should have 2 rows, where the first row is for 'feature_1" column, and the second row is for 'response' column. 2. [2] Calculate & print the linear regression coefficient estimates (Bo and B.) between the above two columns using the following formulas. sdy Bi =r & Bo = y - Bix sd In [ ]: #Answer for 11.1 In [ ]: #Answer for 11.2 B2. [5 Marks] Do the following: 1. [3] Fit OLS regression model on the first 150 rows (index 0 to 149 inclusive) of the given data. Do not normalize or scale any columns. Print the coefficient estimates 2. [2] Calculate & print the MSE on the remaining rows of the data (rows from index 150 to end) using the above OLS model. B3. [5 Marks] Do the following: 1. [1] Split the given data into train and test data set, such that train data set contains 75% of the given data. Set the random state as 211. 2. [2] Fit and scale the train data such that the mean of each column is zero, and the variance of each column is one. 3. [1] Scale the test data using the above fitted scaler. ]: #Answer for B3.1 ]: #Answer for B3.2 ]: #Answer for B3.3 B4. [4 Marks] 1. [3] Fit Lasso regression model on the entire given data (original data). Do not normalize or scale any columns. Use 7-fold CV and use the following possible values for alpha: [0.001, 0.01, 0.1, 1.0, 10.0]. Print the coefficient estimates. 2. [1] Are there any unrelated input columns in the data? Explain. feature_1 feature_2 feature_3 feature_4 feature_5 feature_6 response 125 256 6000 256.1 16 128 198 0 1 29 8000 32000 32.0 8 32 269 2 29 8000 32000 32.0 8 32 220 3 29 8000 32000 32.0 8 32 172 4 29 8000 16000 32.0 8 16 132 B1. [3 Marks] Do the following: 1. [1] Display "feature_1' column and 'response' column in the transposed format. That is, the table should have 2 rows, where the first row is for 'feature_1" column, and the second row is for 'response' column. 2. [2] Calculate & print the linear regression coefficient estimates (Bo and B.) between the above two columns using the following formulas. sdy Bi =r & Bo = y - Bix sd In [ ]: #Answer for 11.1 In [ ]: #Answer for 11.2 B2. [5 Marks] Do the following: 1. [3] Fit OLS regression model on the first 150 rows (index 0 to 149 inclusive) of the given data. Do not normalize or scale any columns. Print the coefficient estimates 2. [2] Calculate & print the MSE on the remaining rows of the data (rows from index 150 to end) using the above OLS model. B3. [5 Marks] Do the following: 1. [1] Split the given data into train and test data set, such that train data set contains 75% of the given data. Set the random state as 211. 2. [2] Fit and scale the train data such that the mean of each column is zero, and the variance of each column is one. 3. [1] Scale the test data using the above fitted scaler. ]: #Answer for B3.1 ]: #Answer for B3.2 ]: #Answer for B3.3 B4. [4 Marks] 1. [3] Fit Lasso regression model on the entire given data (original data). Do not normalize or scale any columns. Use 7-fold CV and use the following possible values for alpha: [0.001, 0.01, 0.1, 1.0, 10.0]. Print the coefficient estimates. 2. [1] Are there any unrelated input columns in the data? ExplainStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started