Avatar for the denehoffman user
denehoffman
laddu
BlogDocsChangelog

Updates to bootstrapping `Dataset`s

#73Merged
Comparing
bootstrap-updates
(
eb31e39
) with
main
(
d5d2f1c
)
CodSpeed Performance Gauge
0%
Improvements
0
Regressions
0
Untouched
4
New
0
Dropped
0
Ignored
0

Benchmarks

Passed

open benchmark
crates/laddu-core/benches/open_benchmark.rs::benches::open_data_benchmark::open benchmark
CodSpeed Performance Gauge
+2%
72.1 ms
70.5 ms
K-Matrix NLL Performance[1]
crates/laddu/benches/kmatrix_benchmark.rs::benches::kmatrix_nll_benchmark::K-Matrix NLL Performance[1]
CodSpeed Performance Gauge
-1%
44.1 ms
44.3 ms
K-Matrix NLL Performance[4]
crates/laddu/benches/kmatrix_benchmark.rs::benches::kmatrix_nll_benchmark::K-Matrix NLL Performance[4]
CodSpeed Performance Gauge
-1%
44.1 ms
44.4 ms
K-Matrix NLL Performance[2]
crates/laddu/benches/kmatrix_benchmark.rs::benches::kmatrix_nll_benchmark::K-Matrix NLL Performance[2]
CodSpeed Performance Gauge
-1%
44.1 ms
44.5 ms

Commits

Click on a commit to change the comparison range
Base
main
d5d2f1c
+1%
feat: add `Dataset::weighted_bootstrap` This is an implementation of a way to generate a bootstrapped dataset keeping event weights in mind. If an event has a weight of 2.0 (or -2.0), then that event acts like two events in the dataset. If we ignore weights on resampling, we end up with a dataset with the same number of events but a different weighted number of events. This method aims to minimize this effect by sampling each event with a probability proportional to its weight (normalized by all weights). To account for the potential existence of negative weights, we first divide the dataset into positively and negatively weighted events and sample the positive set with probability sum(positive_weights) / (sum(positive_weights) - sum(negative_weights)) (note that the denominator is distinct from the total sum of weights).
9f638fb
8 days ago
by denehoffman
0%
revert: remove weighted_bootstrap This concept was flawed, I don't know why I expected it to work, it clearly oversamples events with higher weights because that's what I told it to do, but this obviously doesn't make the total weight of the dataset consistent. There might be a way to do this if I assume the number of events in a bootstrap need not match the original, but that requires some more thinking which I will leave out for now.
891926f
8 days ago
by denehoffman
0%
style: remove test plot I committed this by mistake
eb31e39
8 days ago
by denehoffman
© 2025 CodSpeed Technology
Home Terms PrivacyDocs