You are on page 1of 1

BUSINESS INTELLIGENCE AND ANALYTICS

MS6840 – JUL - SEP 2022


TUTORIAL

EXERCISE SHEET 5
Exercise 1: Dividing the dataset into train set and test set (2*1 = 2 Points)

(Hint: See Chapter 2 Pages 15 to 33: http://faculty.marshall.usc.edu/gareth-

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)

Exercise 2: Building a linear regression model for prediction (4*1 = 4 Points)

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).

You might also like