How do you choose the KDE bandwidth?
hardAnswer
- (1) Silverman's rule: h = (4/(d+2))^(1/(d+4)) * σ * n^(-1/(d+4)) — closed form, assumes Gaussian data.
- (2) Scott's rule: similar but different exponent.
- (3) Cross-validation of log-likelihood → most principled, more expensive.
- (4) Adaptive bandwidth: h varies with local density.
- Small h → overfit / spiky; large h → over-smooth.
- Rule: start with Silverman, refine with CV if it matters.
Check yourself — multiple choice
- Random
- Silverman / Scott closed forms (assume Gaussian) or CV on log-lik (best); small h = spiky, large h = over-smooth; adaptive bandwidth for local variation
- Same as k
- Not real
KDE bandwidth: Silverman / Scott / CV of log-lik; small = spiky, large = over-smooth.
#density
Practise Unsupervised Learning
214 interview questions in this topic.