Skip to content

feat: add seeded model initialization#21

Merged
kholdrex merged 1 commit into
mainfrom
feat/model-random-seed
Jun 6, 2026
Merged

feat: add seeded model initialization#21
kholdrex merged 1 commit into
mainfrom
feat/model-random-seed

Conversation

@kholdrex
Copy link
Copy Markdown
Member

@kholdrex kholdrex commented Jun 6, 2026

Summary

Adds reproducible model initialization for IrtRuby models through an optional seed: keyword. The default constructor behavior remains unchanged, while seeded constructors use instance-local random generators so reproducible runs do not disturb Ruby's global random number generator.

Changes

  • Adds seed: support to Rasch, 2PL, and 3PL model constructors.
  • Uses seeded instance-local randomness for initial abilities, difficulties, discriminations, and guessings when requested.
  • Adds shared regression coverage for identical seeded results, different initial states for different seeds, and global RNG preservation.
  • Documents reproducible initialization in the README.

Test plan

  • RSpec suite passed.
  • RuboCop passed.
  • Gem build passed.
  • Diff whitespace check passed.

@kholdrex kholdrex merged commit cce8506 into main Jun 6, 2026
5 checks passed
@kholdrex kholdrex deleted the feat/model-random-seed branch June 6, 2026 15:42
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.

1 participant