Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
dd5f19d
move stats into subpackage
mdekstrand May 30, 2025
e3b8d65
rename stats tests
mdekstrand May 30, 2025
80ef1aa
start on a test
mdekstrand May 30, 2025
e83c97b
define exports for lenskit.random
mdekstrand Jun 2, 2025
d20b438
first pass at implementing BLB
mdekstrand Jun 2, 2025
1a6468b
add functions
mdekstrand Jun 2, 2025
1a59f6f
don't export Generator
mdekstrand Jun 2, 2025
98bca5b
refactor BLB and simplify tests
mdekstrand Jun 2, 2025
e79573e
rearrange parameters
mdekstrand Jun 2, 2025
c29f2f3
BLB seems to work
mdekstrand Jun 2, 2025
bfde242
document output
mdekstrand Jun 3, 2025
b91bb81
try to fix BLB tests
mdekstrand Jun 3, 2025
6206f0b
mostly-working tests
mdekstrand Jun 3, 2025
f46344b
BLB window test is slow
mdekstrand Jun 3, 2025
ac4922f
simplify tests?
mdekstrand Jun 3, 2025
75f88e4
split out UB and LB tests
mdekstrand Jun 3, 2025
9cf2fec
use percentages for tests
mdekstrand Jun 3, 2025
118c67c
tighten BLB tolerance for test
mdekstrand Jun 3, 2025
413ef5e
use tracer in BLB
mdekstrand Jun 3, 2025
282ecf7
clean up tracing types
mdekstrand Jun 3, 2025
8bd54aa
Use background thread to generate BLB subsets
mdekstrand Jun 3, 2025
cad1ca9
update defaults and refactor CI width
mdekstrand Jun 6, 2025
5631d70
test for new CI thing
mdekstrand Jun 6, 2025
c243524
more BLB testing
mdekstrand Jun 6, 2025
1829b51
refactor config, add but don't use BCA
mdekstrand Jun 6, 2025
f48afed
fix remaining config run
mdekstrand Jun 6, 2025
d7b3708
initial pass on bias-corrected bootstrap
mdekstrand Jun 6, 2025
f4f8d9c
BCA seems to work now
mdekstrand Jun 6, 2025
1d93c94
do some more re-testing on BLB
mdekstrand Jun 6, 2025
06d45f0
increase default r_window
mdekstrand Jun 6, 2025
6a0ad57
CIs misbehave
mdekstrand Jun 6, 2025
67ef1a7
try better BLB tests and defaults
mdekstrand Jun 10, 2025
ca36487
update BLB test
mdekstrand Jun 10, 2025
12f868e
adjust defaults and test
mdekstrand Jun 12, 2025
38e846a
fix parallel logging
mdekstrand Jun 17, 2025
ac4f953
tweak BLB
mdekstrand Jun 17, 2025
0145985
dial back resource requirement
mdekstrand Aug 13, 2025
a15a344
dial back resource more
mdekstrand Aug 13, 2025
2a78cd4
fix BLB typo + quantile correction bug
mdekstrand Aug 13, 2025
39ce2ad
tweak BLB test parameters + re-randomize
mdekstrand Aug 13, 2025
dfbb152
clean up some testing
mdekstrand Aug 13, 2025
a0ce38d
use the expanded percentile
mdekstrand Aug 13, 2025
0bc70a3
test tweaks
mdekstrand Aug 13, 2025
a71c6c7
more test tweaking
mdekstrand Aug 13, 2025
15234dc
instrumentation and configurability
mdekstrand Aug 14, 2025
887e1bb
log CI centers and widths
mdekstrand Aug 14, 2025
4004459
readability cleanup
mdekstrand Aug 14, 2025
d34ea14
fix up logging etc.
mdekstrand Aug 14, 2025
4272277
fix result docs
mdekstrand Aug 14, 2025
fb76932
some blb update
mdekstrand Aug 14, 2025
5cf1880
test tweaks
mdekstrand Aug 14, 2025
53a3714
refactor test to make more tests easier
mdekstrand Aug 14, 2025
8972837
refactor tests and test the t-test
mdekstrand Aug 14, 2025
df701c3
compute samples in-thread
mdekstrand Aug 14, 2025
2d6fefb
eliminate parallel replicate logic
mdekstrand Aug 14, 2025
2e6660d
eliminate BCa logic
mdekstrand Aug 14, 2025
0a5182d
support minimum inner iterations
mdekstrand Aug 14, 2025
82e8475
tweak up params for BLB test
mdekstrand Aug 14, 2025
76334fe
one more param tweak
mdekstrand Aug 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,228 changes: 1,228 additions & 0 deletions notebooks/BLB.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/lenskit/logging/multiprocess/_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def current(cls, *, from_monitor: bool = True):
if mon.log_address is None:
raise RuntimeError("monitor has no log address")
cfg = active_logging_config()
level = cfg.effective_level if cfg is not None else logging.INFO
level = cfg.effective_level if cfg is not None else logging.DEBUG
return cls(
address=mon.log_address, level=level, authkey=bytes(mp.current_process().authkey)
)
Expand Down
6 changes: 4 additions & 2 deletions src/lenskit/parallel/ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def init_cluster(
proc_slots: int | None = None,
resources: dict[str, float] | None = None,
worker_parallel: ParallelConfig | None = None,
global_logging: bool = False,
global_logging: bool = True,
**kwargs,
):
"""
Expand Down Expand Up @@ -130,7 +130,7 @@ def init_cluster(
setup = _worker_setup if global_logging else None
runtime = ray.runtime_env.RuntimeEnv(env_vars=env, worker_process_setup_hook=setup)

_log.info("starting Ray cluster")
_log.info("starting Ray cluster", logging=global_logging)
ray.init(num_cpus=num_cpus, resources=resources, runtime_env=runtime, **kwargs)


Expand Down Expand Up @@ -422,5 +422,7 @@ def init_worker(*, autostart: bool = True) -> WorkerContext:
if autostart:
context.start()

_log.debug("worker context initialized")

ensure_parallel_init()
return context
16 changes: 16 additions & 0 deletions src/lenskit/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
if TYPE_CHECKING: # avoid circular import
from lenskit.data import RecQuery

__all__ = [
"SeedLike",
"RNGLike",
"RNGInput",
"ConfiguredSeed",
"SeedDependency",
"DerivableSeed",
"load_seed",
"set_global_rng",
"init_global_rng",
"random_generator",
"make_seed",
"RNGFactory",
"derivable_rng",
]

SeedLike: TypeAlias = int | Sequence[int] | np.random.SeedSequence
"""
Type for RNG seeds (see `SPEC 7`_).
Expand Down
15 changes: 15 additions & 0 deletions src/lenskit/stats/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This file is part of LensKit.
# Copyright (C) 2018-2023 Boise State University.
# Copyright (C) 2023-2025 Drexel University.
# Licensed under the MIT license, see LICENSE.md for details.
# SPDX-License-Identifier: MIT

from ._blb import blb_summary
from ._gini import gini
from ._topn import argtopn

__all__ = [
"gini",
"argtopn",
"blb_summary",
]
Loading
Loading