jackyan540 / cs181-homework1

Spring 2021 Machine Learning (CS 181) Homework 1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cs181-homework1

Spring 2021 Machine Learning (CS 181) Homework 1

Problem Topics

Solutions contained in the personal-solutions folder

  1. Optimizing for Kernel-Based Regression
  2. Kernels and K-Nearest Neighbors
  3. Deriving Linear Regression
  4. Linear Regression with Basis Functions

Code

Implementation contained in the code folder

problem1_4-Kernel-Loss-Function.py

  • Referred to as T1_P1.py in the specifications
  • Calculates the loss with respect to three different kernels for the provided dataset

problem1_5-Gradient-Descent.py

  • Optimizes a kernel-based regressor using gradient descent

problem2_1-kNearestNeighbors.py

  • 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

problem4-OLS-with-Basis-Functions.py

  • 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

About

Spring 2021 Machine Learning (CS 181) Homework 1


Languages

Language:Python 100.0%