# Cross-Validation From Scratch: A Surprise at n=100

Original title: Cross-Validation From Scratch and a Surprise at n=100

> Hacker News story 49289893 · language: en · submitted 2026-08-13
> Web version: https://zeli.app/story/49289893
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 7 · by [sebg](<https://news.ycombinator.com/user?id=sebg>) · 💬 0
[original](<https://www.kenkoonwong.com/blog/crossvalidation/>) · [HN discussion](<https://news.ycombinator.com/item?id=49289893>)

## Summary

Textbooks claim LOOCV has the lowest bias but highest variance compared to 10-fold and 5-fold CV. I coded K-Fold CV from scratch to test this on simulated data. At n=1000, the claim holds, but at n=100, the order flips—LOOCV shows negative bias and higher variance, contrary to expectations. The post also explores recovering the true data-generating process via CV and notes that the slope from regressing y on predictions is less than 1 due to attenuation bias.

## Key quote

> With n=100, the bias and variance order heuristics no longer hold up? Why is this? I don’t know. If you do, please let me know.

---

## Cite

- Page: https://zeli.app/story/49289893
- Date: 2026-08-13
- Source: kenkoonwong.com (https://www.kenkoonwong.com/blog/crossvalidation/)
- Hacker News: https://news.ycombinator.com/item?id=49289893

## Other languages

- zh: https://zeli.app/zh/story/49289893 · markdown: https://zeli.app/zh/story/49289893.md
