Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example 3.5 #86

Open
crossxwill opened this issue Jan 24, 2020 · 0 comments
Open

Example 3.5 #86

crossxwill opened this issue Jan 24, 2020 · 0 comments

Comments

@crossxwill
Copy link

The example below was supposed to show K=5 is better than K=1. However, the test error for K=1 is much lower than K=5.

The test set sample’s sale price is $176K and the neighbor’s prices, from closest to farthest, are: $175K, $128K, $100K, $120K, $125K. Using K = 1, the model would miss the true house price by $0.9K. This illustrates the concept of overfitting introduced in Section 1.2.1; the model is too aggressively using patterns in the training set to make predictions on new data points. For this model, increasing the number of neighbors might help alleviate the issue. Averaging all K = 5 points to make a prediction substantially cuts the error to $-46.4K.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant