You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds generate_batched_binary_dataset_with_oracle_sampling, which generates a stream of binary datasets with oracle uncertainty scores, one per batch, with per-batch n_samples, true_mean, proxy_mean and correlation (e.g. to inject a drift in actively sampled data). It is exported from glide.simulators and listed in the API reference.
The per-batch loop, SeedSequence spawning, per-batch call, np.full_like batch ids and np.hstack assembly are copied from batched_stratified_binary and batched_clustered_binary, with only the inner generator swapped. This is a third copy, so a future change to batch-id dtype or seed derivation has to be made in three places and can silently diverge. It goes against the "No Redundancy" rule. A shared private helper taking the inner generator would avoid it (could also be a follow-up refactor).
2. No test for an infeasible batch (tests/unit/simulators/test_batched_oracle_binary.py)
The docstring's Raises section says a ValueError is propagated when any batch is infeasible, but no unit test asserts it (e.g. a correlation outside the feasible range for batch 1 only). The sibling batched tests cover this path.
3. SeedSequence input has no direct test (glide/simulators/oracle_binary.py:14)
random_seed was widened to accept np.random.SeedSequence, but only the batched wrapper exercises it, indirectly. A regression would only surface through the batched test's hard-coded values, not in test_oracle_binary.py.
4. Doctest is weak (glide/simulators/batched_oracle_binary.py:67)
The example only checks lengths and the number of unique batches. It never inspects y_proxy, the uncertainty output or the batch ids, so a bug applying batch 0's parameters to every batch would still pass, and it does not show the batch-wise drift the function exists for.
5. Type annotation gap (glide/simulators/batched_oracle_binary.py:15) (minor)
The batched wrapper still annotates random_seed as Optional[int], while generate_binary_dataset_with_oracle_sampling now takes Optional[Union[int, np.random.SeedSequence]]. The batched stratified and clustered wrappers have the same gap, so this is a consistency issue, not a crash.
6. API index row placement (docs/api/index.md:15) (minor)
The new row sits between the batched clustered and batched stratified entries, not next to the non-batched oracle simulator (line 11), and is not in alphabetical or logical order.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ASILinked to active statistical inferencefeatureNew feature or requestSimulators
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
generate_batched_binary_dataset_with_oracle_sampling, which generates a stream of binary datasets with oracle uncertainty scores, one per batch, with per-batchn_samples,true_mean,proxy_meanandcorrelation(e.g. to inject a drift in actively sampled data). It is exported fromglide.simulatorsand listed in the API reference.generate_batched_binary_dataset_with_oracle_samplingsimulator #508Checklist
Quality gates that must be satisfied before requesting a review:
CONTRIBUTING.mdmake lintpassesmake type-checkpassesmake testspassesmake coveragereports 100% coveragemake test-notebookspassesmake doc)CHANGELOG.mdupdated if the change is user-facingLLM usage
Disclose if an LLM was used in writing this PR:
🤖 Generated with Claude Code