This project is a Flask web application that predicts whether a person is at risk of heart disease using a pre-trained Machine Learning model (heart-disease.pkl).
It provides a simple web interface (index.html) where users can input medical parameters and get instant predictions.
- Built with Flask
- Uses a pickled ML model (Logistic Regression / sklearn)
- Deployed on AWS Elastic Beanstalk
- Frontend: HTML templates (Jinja2)
- Prediction served via Gunicorn (WSGI server)
.
├── application.py # Flask entry point
├── heart-disease.pkl # Trained ML model
├── Procfile # Tells EB to use Gunicorn
├── requirements.txt # Python dependencies
├── templates/
│ └── index.html # Web form for inputs + results
└── README.md # Project documentation
-
Clone this repository:
git clone https://github.com/your-username/heart-disease-prediction.git cd heart-disease-prediction -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Linux/Mac venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Run the app locally:
python application.py
Visit:
http://127.0.0.1:5000/
-
Ensure you have these files in project root:
application.pyrequirements.txtProcfileheart-disease.pkltemplates/
-
Initialize EB environment:
eb init -p python-3.9 heart-disease-app
-
Create an environment and deploy:
eb create heart-disease-env eb deploy
-
Open in browser:
eb open
Key Python dependencies (see requirements.txt for full list):
- Flask
- gunicorn
- numpy
- scikit-learn
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License.