ContextLab / ContextLab/htfa

Implement HTFA parameter support: n_levels, backend, random_state

Aperta
#91 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
1
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Description
The current HTFA implementation is missing several expected parameters that are tested in the disabled test suite.

## Missing Parameters
- `n_levels` - Control number of hierarchical levels (currently assumes 2)
- `backend` - Support for different computational backends (NumPy, JAX, PyTorch)
- `random_state` - Ensure reproducible results
- `max_iter` - Control maximum iterations for convergence

## Expected Behavior
```python
# Should work:
model = HTFA(n_factors=5, n_levels=3, backend="numpy", random_state=42, max_iter=100)
```

## Current Status
These parameters cause `TypeError: unexpected keyword argument` errors.

## Tests to Re-enable
When this is implemented, re-enable the following tests in `tests/test_htfa_core.py.disabled`:
- `test_htfa_initialization`
- `test_htfa_different_levels`
- `test_htfa_reproducibility`
- `test_invalid_backend`
- All parametrized tests using `n_levels`

## Implementation Notes
- Backend support should start with NumPy and be extensible
- `n_levels=1` should work like standard factor analysis
- Random state should control all random operations for reproducibility

## Related Files
- `htfa/core/htfa.py` - Main implementation
- `tests/test_htfa_core.py.disabled` - Tests to re-enable

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da htfa/core/htfa.py e leggi i casi disabilitati in tests/test_htfa_core.py.disabled per comprendere il comportamento previsto del costruttore e la validazione. Riabilita test_htfa_initialization, test_htfa_different_levels, test_htfa_reproducibility, test_invalid_backend e i test parametrizzati di n_levels; il lavoro è completato quando i parametri elencati vengono accettati e questi test hanno esito positivo.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
numpy, python, pytorch
Ambito
machine-learning
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.