Worksheet 26: Nearest Neighbors#
Your name:
Your student ID number:
Your high school friend has just moved to the bay area. Your roommate wants you to set them up on a date. How do you decide if they will be compatible?
What would your \(1\)-nearest-neigbhor prediction be for the point \(x_{new}\) be? What would your \(2\)-nearest-neighbor prediction be?
{width=”5cm”}
What do you notice about the \(k\)-nearest neighbor model prediction as \(k\) increases? Do you see a disadvantage to taking \(k\) too small? Do you see a disadvantage to taking \(k\) too large?
Assume that only one example data point has features \(x_i\). If \(k = 1\), what will \(\hat y = f(x_i)\) be?
Brainstorm as many advantages and disadvantages as you can for using \(k\)-nearest neighbors vs. linear regression.