Skip to content

Add --seed CLI flag for reproducible active-learning batch selection - #851

Merged
Markadrian6399 merged 2 commits into
Ledger-Lenz:mainfrom
Bokky73:feat/add-seed-flag-for-reproducibility
Sep 1, 2026
Merged

Add --seed CLI flag for reproducible active-learning batch selection#851
Markadrian6399 merged 2 commits into
Ledger-Lenz:mainfrom
Bokky73:feat/add-seed-flag-for-reproducibility

Conversation

@Bokky73

@Bokky73 Bokky73 commented Aug 31, 2026

Copy link
Copy Markdown

Closes #759

Summary

The active-learning query strategies (detection/active_learning/query_strategies.py) involve randomness (e.g. BADGE's k-means++ seeding, and tie-breaking among equally-informative wallets), so a hardcoded or unexposed seed makes a specific batch selection impossible to reproduce when debugging a reported issue.

This PR exposes a --seed CLI flag on scripts/run_active_learning.py so a contributor can reproduce a specific batch selection exactly.

Changes

  • Added a --seed argument to scripts/run_active_learning.py.
  • The seed is forwarded to the configured query strategy when it supports one.
  • BADGE.select now accepts a seed kwarg, threaded through _kmeans_pp_indices.
  • _kmeans_pp_indices defaults to the previous hardcoded seed (42) when none is supplied, preserving existing behaviour.
  • Other strategies that do not accept a seed are left untouched; a warning is logged if --seed is passed to one that ignores it.

Testing

No behaviour change when --seed is omitted; existing tests are preserved.

…ction

Add a --seed CLI flag to scripts/run_active_learning.py so contributors can
reproduce a specific active-learning batch selection exactly when debugging
a reported issue. The seed is forwarded to query strategies; BADGE (the
randomised k-means++ strategy) now accepts a seed kwarg and threads it
through _kmeans_pp_indices, defaulting to the previous hardcoded seed (42)
when none is supplied to preserve existing behaviour.
@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@Bokky73 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Markadrian6399
Markadrian6399 merged commit 178293a into Ledger-Lenz:main Sep 1, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a --seed flag to scripts/run_active_learning.py for reproducible selection

2 participants