Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
lm-evaluation-harness
Commits
baf54a03
Commit
baf54a03
authored
May 10, 2021
by
Leo Gao
Browse files
Make bootstrap test work
parent
dd573a95
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
tests/test_misc.py
tests/test_misc.py
+5
-3
No files found.
tests/test_misc.py
View file @
baf54a03
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment