Skip to content

Assignment: Linear and Sparse Regression Consider the attached dataset about advertising and sales. The attributes denote the investments on advertising in TV, radio etc and the target variable is the total sales. The aim is to predict the sales from the investments on advertising. 1) Randomly divide the dataset into training (75%) and testing (…

Moozzart/Linear-and-Sparse-Regression-

Repository files navigation

Linear-and-Sparse-Regression-

Assignment: Linear and Sparse Regression Consider the attached dataset about advertising and sales. The attributes denote the investments on advertising in TV, radio etc and the target variable is the total sales. The aim is to predict the sales from the investments on advertising.

1) Randomly divide the dataset into training (75%) and testing (25%) subsets

2) Using Linear Regression, fit a model to predict the sales from investments using your own formula. Compare the coefficients as found by the python library function

3) Compute the mean squared error on the testing set

4) Using ridge regression with different values of lambda (0.5, 1, 5, 10, 50, 100) plot the coefficients against each other, and also compare the test set mean squared errors

5) Use the library function of "LASSO regression" to find out which of the 3 features is most important, i.e. whose coefficient is furthest from 0

About

Assignment: Linear and Sparse Regression Consider the attached dataset about advertising and sales. The attributes denote the investments on advertising in TV, radio etc and the target variable is the total sales. The aim is to predict the sales from the investments on advertising. 1) Randomly divide the dataset into training (75%) and testing (…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published