How tanyax1205/healthprediction works
MultiDx is a multi-disease screening product: users select a task, enter clinical or symptom data, receive a model-based risk/differential with explanation, and can review performance, batch results, or local history. The React dashboard calls a FastAPI service, which loads trained artifacts at startup and exposes task schemas, predictions, metrics, and system status. Separately, the ML package loads datasets, trains and evaluates task models, and exports artifacts consumed by the service. The legacy Streamlit app is documented as reference-only. Some frontend and backend subsystems are included from README capabilities; their internal wiring was not sampled.
Main entry points: train.py Training orchestration · registry.py Artifact registry · main.py FastAPI application · predict.py Prediction service
Components 28
Screening dashboard
- Dashboard app
frontend/src/App.tsx - Screening pages
frontend/src/pages - Dynamic predictor form
frontend/src/components/predictor - Risk and SHAP results
frontend/src/components/result - Batch screening
frontend/src/pages/Batch.tsx - Local history
frontend/src/store/history.ts - API client
frontend/src/lib/api.ts
Prediction API
- FastAPI application
backend/app/main.py - Task schema routes
backend/app/api/routes/tasks.py - Prediction routes
backend/app/api/routes/predict.py - Metrics routes
backend/app/api/routes/metrics.py - System routes
backend/app/api/routes/system.py - Artifact registry
backend/app/services/registry.py - Prediction service
backend/app/services/predict.py - CSV processing
backend/app/services/csv.py
Model pipeline
- Trained artifacts
- Task and model configuration
ml/config.py - Dataset loading
ml/data_loader.py - Feature schemas
ml/schema/features.py - Training orchestration
ml/train.py - Preprocessing pipelines
ml/preprocessing.py - Model implementations
ml/models.py - Evaluation and calibration
ml/evaluate.py - Results export
ml/export.py
Clinical interpretation
- Clinical unit conversion
ml/schema/units.py - Clinical rule sets
ml/rules - SHAP explanations
ml/explain.py
Other components
- Clinician or user
Connections 35
- Clinician or user → Screening pages: uses
README.md - Screening pages → Dynamic predictor form: opens predictor
README.md - Dynamic predictor form → API client: submits inputs
README.md - API client → Prediction routes: requests prediction
README.md - API client → Task schema routes: loads task schemas
README.md - Prediction routes → Prediction service: invokes
backend/app/api/routes/predict.py - Prediction routes → CSV processing: processes batch CSV
backend/app/api/routes/predict.py - Task schema routes → Artifact registry: reads task schemas
backend/app/api/routes/tasks.py - Metrics routes → Artifact registry: reads metrics
backend/app/api/routes/metrics.py - System routes → Artifact registry: reads versions
backend/app/api/routes/system.py - FastAPI application → Task schema routes: registers router
backend/app/main.py - FastAPI application → Prediction routes: registers router
backend/app/main.py - FastAPI application → Metrics routes: registers router
backend/app/main.py - FastAPI application → System routes: registers router
backend/app/main.py - FastAPI application → Artifact registry: loads at startup
backend/app/main.py - Artifact registry → Trained artifacts: loads models
backend/app/services/registry.py - Artifact registry → Feature schemas: builds schemas
backend/app/services/registry.py - Prediction service → Clinical unit conversion: converts units
backend/app/services/predict.py - Prediction service → Clinical rule sets: evaluates clinical rules
backend/app/services/predict.py - Prediction service → SHAP explanations: generates SHAP
backend/app/services/predict.py - Prediction service → Risk and SHAP results: returns interpretation
README.md - Screening pages → Metrics routes: requests performance data
README.md - Batch screening → API client: uploads cohort CSV
README.md - Screening pages → Local history: browses screenings
README.md - Training orchestration → Dataset loading: loads datasets
ml/train.py - Training orchestration → Preprocessing pipelines: builds pipelines
ml/train.py - Training orchestration → Model implementations: fits candidates
ml/train.py - Training orchestration → Evaluation and calibration: evaluates models
ml/train.py - Training orchestration → Task and model configuration: uses task settings
ml/train.py - Training orchestration → Trained artifacts: saves models
README.md - Dataset loading → Task and model configuration: uses dataset settings
ml/data_loader.py - Model implementations → Task and model configuration: uses model settings
ml/models.py - Preprocessing pipelines → Task and model configuration: uses task settings
ml/preprocessing.py - Preprocessing pipelines → Model implementations: builds model pipeline
ml/preprocessing.py - Results export → Trained artifacts: exports results
README.md