Skip to content

Random State Threading #157

@jeremymanning

Description

@jeremymanning

Parent Epic: #155

Task: Random State Threading

Description

Propagate the random_state parameter through all stochastic operations in both TFA and HTFA classes to ensure reproducible results.

Acceptance Criteria

  • K-means initialization uses random_state
  • Factor initialization uses random_state
  • All scipy/sklearn calls receive random_state
  • Results are reproducible with same random_state
  • None random_state still works (non-deterministic)

Technical Details

  • Update htfa/core/tfa.py K-means initialization
  • Modify factor initialization in _initialize_factors method
  • Thread through to scipy.sparse.linalg functions
  • Pass to sklearn clustering/decomposition calls
  • Create RandomState object once and reuse

Dependencies

  • Task 164 must be complete (parameters added)

Effort Estimate

  • Size: M
  • Hours: 6-8
  • Parallel: false

Definition of Done

  • Code implemented in htfa/core/tfa.py and htfa/core/htfa.py
  • Test for reproducibility added
  • Verified same seed produces same results
  • Documentation updated
  • Code reviewed

Status

COMPLETED - All stochastic operations now use random_state for full reproducibility.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions