Spring 2021 Machine Learning (CS 181) Homework 1
Solutions contained in the
personal-solutions
folder
- Optimizing for Kernel-Based Regression
- Kernels and K-Nearest Neighbors
- Deriving Linear Regression
- Linear Regression with Basis Functions
Implementation contained in the
code
folder
- Referred to as
T1_P1.py
in the specifications - Calculates the loss with respect to three different kernels for the provided dataset
- Optimizes a kernel-based regressor using gradient descent
- Referred to as
T1_P2.py
in the specifications - Plots and compares predictions from a kernel-based regressor and from a nearest neighbor-based regressor
- Referred to as
T1_P4.py
in the specifications - Plots data and ordinary least squares regression lines over multiple different basis functions
- Calculates the residual sum-of-squares error for each basis regression