Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Multiple Linear Regression

1. Upload the dataset Cellphone.csv


2. Read the file and display the top 7 rows
3. Drop the columns project_id and Product_id
4. Check if the dataset has missing values. If so, treat this issue by either dropping rows that have
missing values or by replacing missing values by median / mean
5. Display the statistics (Describe) of columns that have numerical values
6. Divide the dataset into Input (X) and Output (Y). Please note that in this dataset, the output is
‘Price’ which is not the last column. In order to do so, use the code below

7. We want to use stepwise regression to choose the independent variables that are statistically
significant at 95% critical interval. First. Install stepwise regression.

8. choose the independent variables using stepwise regression

from stepwise_regression import step_reg


p_value = 0.05
selected_features = step_reg.backward_regression(X, Y,
p_value,verbose=True)
print("="*60)
selected_features
9. Split the dataset into 75% training and 25% testing using hold out method. Use X_modified for
clean data
10. Generate multiple linear regression

11. Test the model

12. Find the model performance using MAE, MSE and R2

13. Check if there are any mild outliers. If so, remove the outliers and test the model again
14. Design a MutiLayer Perceptron (MLP) to predict the ‘price’. Choose proper parameters and
activation function
15. Compare between MLP and MLR. Which one is better? Justify your answer.

You might also like