How sinchana2612/renaltwin works
RenalTwin is a research prototype for maintaining longitudinal kidney-health twins and generating 365-day renal-risk estimates. The documented user workflow runs from twin creation and time-stamped observation entry through validation, twin-state calculation, readiness checks, feature construction, prediction, and dashboard presentation. The graph combines sampled API, feature, and model code with README-documented capabilities; the twin engine and dashboard implementations were not excerpted, so their internal call details are limited to documented relationships.
Main entry points: engine.py Twin engine · main.py FastAPI · cli.py Research CLI · assemble.py Feature assembly
Components 14
User experience
- Streamlit dashboard
dashboard/app.py - Research CLI
src/renaltwin/cli.py
Twin backend
- FastAPI
src/renaltwin/api/main.py - Twin engine
src/renaltwin/twin/engine.py - Unit conversion
src/renaltwin/units.py - eGFR and CKD stage
src/renaltwin/egfr.py - Runtime configuration
src/renaltwin/config.py
Risk analytics
- Feature assembly
src/renaltwin/features/assemble.py - Clinical features
src/renaltwin/features/clinical_features.py - Sensor features
src/renaltwin/features/sensor_features.py - Risk prediction
src/renaltwin/ml/predictor.py - Model training
src/renaltwin/ml/train.py
Persistence
- Twin and risk store
src/renaltwin/db/store.py
Other components
- Research user
Connections 17
- Research user → Streamlit dashboard: uses
README.md - Streamlit dashboard → FastAPI: sends HTTP requests
README.md - FastAPI → Twin engine: routes twin operations
src/renaltwin/api/main.py - FastAPI → Twin and risk store: initializes and deletes
src/renaltwin/api/main.py - FastAPI → Risk prediction: loads model
src/renaltwin/api/main.py - FastAPI → Runtime configuration: gets artifact paths
src/renaltwin/api/main.py - Twin engine → Twin and risk store: persists twin data
README.md - Twin engine → Unit conversion: normalizes observation units
README.md - Twin engine → eGFR and CKD stage: derives CKD stage
README.md - Twin engine → Feature assembly: builds prediction features
README.md - Twin engine → Risk prediction: runs ready predictions
README.md - Feature assembly → Clinical features: builds clinical features
src/renaltwin/features/assemble.py - Feature assembly → Sensor features: builds sensor features
src/renaltwin/features/assemble.py - Research CLI → Runtime configuration: gets data paths
src/renaltwin/cli.py - Research CLI → Model training: starts training
src/renaltwin/cli.py - Research CLI → Twin and risk store: initializes store
src/renaltwin/cli.py - Research CLI → Twin engine: seeds demo twin
src/renaltwin/cli.py