Homework 1

Homework 1#

Linear Regression

Learning Objectives#

  • Derive the gradients needed to fit a linear regression model.

  • Translate mathematical quantities into code by implementing linear regression and loss function evaluations.

  • Practice with a feature selection task for a real-world regression problem.

  • Consider the ethics of data collection.

Homeworks in this course are often split into two notebooks to make it easier to manage the code:

  • Part 1 is focused on mathematical foundations and implementation of gradient descent for a linear regression model with two features.

  • Part 2 is focused on building a linear regression model class and evaluating it on a real-world regression problem.

Tip

I recommend that you test your functions in Part 1 with the Gradescope autograder before moving on to Part 2. That way you’ll have more certainty that your functions are working correctly for Part 2.

If you are uncertain or have questions about any portion of the homework, please do come to my office hours, Bhargavi’s TA hours, or reach out on Ed!

Note

This homework is due Monday 2/16 at 11:59pm.