The problem with straight bootstrapping

What you could see happening was that with a single observation of data, bootstrapping will give the same answer every time. Ironically, this means that when you're bootstrapping such a small dataset, you will have zero variance. Here's an example in code:

plt.hist([np.random.choice([1]) for i in range(100)])

The histogram for sampling from a dataset that consists of only one element looks as follows:

The problem with straight bootstrapping

As predicted, every value is the same. This doesn't really match our intuition about uncertainty though. We have only observed a single number, but it could have just as easily been a different number. This technique ...

Get Test-Driven Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.