Welcome to the Heart Failure Prediction project! This repository contains the code and resources for building a machine learning model to predict heart failure based on clinical data.
Heart failure is a severe condition in which the heart is unable to pump blood effectively. Early prediction of heart failure can significantly improve patient outcomes. This project aims to build a predictive model using machine learning techniques to identify patients at risk of heart failure.
The dataset used for this project contains clinical features of patients, such as age, sex, ejection fraction, serum creatinine levels, and more. The dataset can be found in the data
directory. It is crucial to ensure the data is preprocessed correctly before training the model.
To run this project, you will need the following packages and libraries:
- Python 3.7+
- NumPy
- Pandas
- Scikit-learn
- Matplotlib
- Seaborn
- Jupyter Notebook (optional, for interactive development)
-
Clone the repository:
git clone https://github.com/your-username/heart-failure-prediction.git cd heart-failure-prediction
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Ensure your dataset is in the
data
directory. -
Run the preprocessing script to clean and prepare the data:
python preprocess.py
-
Train the model using the prepared data:
python train.py
-
Evaluate the model performance:
python evaluate.py
-
(Optional) Run the Jupyter Notebook to interactively explore the data and results:
jupyter notebook Heart_Failure_Prediction.ipynb
The trained model achieves a high accuracy and recall in predicting heart failure. Detailed evaluation metrics and visualizations can be found in the Heart_Failure_Prediction.ipynb
file.
Contributions are welcome! If you have any ideas, suggestions, or bug fixes, please open an issue or submit a pull request. Ensure your code adheres to the existing style and include relevant tests.
We would like to thank the contributors and the community for their valuable input and support. Special thanks to the providers of the dataset for making this project possible.