Description
Project 1 is to implement the basic linear regression algorithm as described in video lectures 2.1—2.5.
Your algorithm should assume that an input file has an m (lines of data) and a n (number of features) on
the first line of the file. Each line after that contains n features and the value associated with those
features. For example, from lecture 2.5 an input file for the house data might be:
15 3
2 3 1060 119,000
4 2 1195 125,000
4 2 1199 125,000
1 1 925 131,000
3 2 1014 175,000
3 3 1197 175,000
3 2 1008 187,400
3 1 1352 194,000
3 2 1773 200,000
4 3 1625 225,000
4 4 1827 228,000
3 4 1325 235,000
3 3 2120 250,000
4 3 2700 274,500
5 4 2659 319,900
Your program should prompt the user for a training file. Using the training file, it should compute and
print out to the screen the computed weights and the J value. Next, your program should ask the user
for a test file. Using the weights computed from the training file, it should then print out J for the test
file. All output should be clearly labelled.
Your Python program should be named yourlastname_yourfirstname_P1.py, then zipped and
uploaded to Canvas.