How killich8/end-to-end-cardiovascular-disease works
Project type and purpose
• This is an end-to-end machine-learning application for cardiovascular disease prediction.
• It contains both an ML-pipeline (data ingestion → validation → transformation → training → evaluation) and a web front-end (HTML/CSS/JS templates served via app.py) for user input and prediction results.
File structure
• Top-level code:
• main.py – CLI entry point to run the entire pipeline
• app.py – Flask (or similar) web server for prediction
• template.py – likely auxiliary template rendering logic
• Dockerfile, .github/workflows/cicd.yaml – containerization & CI/CD
• Artifacts directory – intermediate outputs (raw ingested data, transformed datasets, trained model, evaluation metrics)
• config/ + params.yaml + schema.yaml – configuration & hyperparameters
• src/Cardiovascular_Disease/ – core Python package
• components/ – data_ingestion, data_validation, data_transformation, model_trainer, model_evaluation
• pipeline/ – orchestration of stages (stage_01_… through stage_05_…) + prediction pipeline
• config/ – code to load config files
• entity/ – dataclasses or config entities
• utils/ – common helper functions
• static/ + templates/ – front-end assets and HTML
README (and image)
• Confirms that the repo covers the full lifecycle of a cardio-disease model, from EDA in research/ to deployment.
a. Main components:
• Data Sources: raw CSV in data/ (heart_failure.csv)
• Configuration: config/config.yaml, params.yaml, schema.yaml
• ML Pipeline (CLI via main.py):
– Data Ingestion → Data Validation → Data Transformation → Model Trainer → Model Evaluator
– Artifacts stored under artifacts/
• Web Layer (via app.py):
– HTTP Server (Flask) + Templates/static assets
– Prediction Pipeline (loads model.joblib, scalers.pkl, label_encoders.pkl)
• Continuous Integration/Deployment:
– GitHub Actions workflow (cicd.yaml) + Dockerfile
b. Relationships and interactions:
• main.py reads configs → invokes pipeline stages in sequence → writes artifacts
• app.py loads trained model artifact → serves prediction endpoint → renders templates
• Both CLI and Web share src/Cardiovascular_Disease package
• CI/CD builds Docker image → runs tests and deploys container
c. Architectural patterns / design principles:
• Modular pipeline stages (separation of concerns)
• Config-driven design (all paths & hyperparameters in YAML)
• Package structure for reusability (components, utils, entity, config)
• Single application serving both CLI and Web
d. Key technologies / frameworks:
• Python package with setup.py
• Flask (or similar) web framework
• scikit-learn (model.joblib), pandas, numpy
• GitHub Actions, Docker