Bias Variance Tradeoff
Bias Variance Tradeoff
less than a minute
KNN Dataset
Let’s use this dataset to understand the impact of number of neighbours ‘k’.

High Bias, Low Variance
👉If ‘k’ is very large, say, k=n,
- model simply predicts the majority class of the entire dataset for every query point , i.e, under-fitting.
High Variance, Low Bias
👉If ‘k’ is very small, say, k=1,
- model is highly sensitive to noise or outliers, as it looks at only 1 nearest neighbor, i.e, over-fitting.
‘K' Hyper-Parameter Tuning
Let’s plot Error vs ‘K’ neighbors:

Over-Fitting Vs Under-Fitting
Figure 1: k=1, Over-fitting
Figure 2: k=n, Under-fitting
Figure 3: k=11, Lowest Error (Optimum)

End of Section