Professional Documents
Culture Documents
EXERCISE SHEET 5
Exercise 1: Dividing the dataset into train set and test set (2*1 = 2 Points)
james/ISL/ISLR%20Seventh%20Printing.pdf )
1. Write R/ Python code to divide the given advertising dataset into train set (75 %) and test set
(25%). (Consider Sales as dependent variable and TV, Radio, Newspaper as independent
variables)
1. Write R/Python code to build a linear regression model using the training data and predict the
values for the test data.
2. Calculate the accuracy of the model (both on train set and test set) using Mean Square Error
(MSE).