Commit baf54a03 authored by Leo Gao's avatar Leo Gao
Browse files

Make bootstrap test work

parent dd573a95
import pytest
import lm_eval.metrics as metrics
import random
def test_bootstrapping():
arr = list(range(100))
random.seed(42)
arr = [random.random() for _ in range(100)]
expected = metrics.mean_stderr(arr)
bootstrapped = metrics.bootstrap_stderr(metrics.mean, arr)
bootstrapped = metrics.bootstrap_stderr(metrics.mean, arr, iters=100000)
assert bootstrapped == pytest.approx(expected)
assert bootstrapped == pytest.approx(expected, abs=1e-4)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment