- Introduction
- Project Structure
- Installation
- Usage
- Model Explanation
- Results
- Contributors
The Heart Attack Prediction System is a machine learning project designed to predict the likelihood of a heart attack based on several health parameters like cholesterol level, blood pressure (Systolic & Diastolic), heart rate, gender, blood sugar, CK-MB, troponin, and age. The model was developed using Python, utilizing logistic regression and random forest classifiers.
Heart_Attack_Prediction_System/ ├── data/ │ ├── heart.csv ├── notebooks/ │ ├── EDA.ipynb │ ├── model_training.ipynb ├── src/ │ ├── model.py │ ├── preprocess.py │ └── utils.py ├── app/ │ ├── app.py │ └── templates/ ├── requirements.txt └── README.md
Pre-requisite: Git Bash, download the latest version of git bash from; https://git-scm.com/downloads
Follow these steps to set up the project on your local machine, try these commands to put on GitBash:
-
Clone the repository: git clone https://github.com/Samarth5101/Heart_Attack_Prediction_System.git
-
Navigate to the project directory: cd Heart_Attack_Prediction_System
-
Install the required Python packages: pip install -r requirements.txt
-
To run the Flask app locally: python app/app.py
After, Installing this repository and poking gitbash you should run some commands on your terminal of your local IDE, but before this please add this whole project on your local IDE.
Try these commands on your local IDE :
-
For Backend
1.1 Open up a fresh terminal and type:
1.1.1cd backend
1.1.2nodemon index.js
-
For Frontend
2.1 Open up a fresh terminal again and type:
2.1.1cd frontend
2.1.2npm run dev
-
For Flask server
3.1 Open up a fresh terminal again and:
3.1.1 Run the code offlaskserver.py
-
For live site
4.1 Navigate back to "node frontend"
4.2 Focusing on the same terminal frontend's output, find your Local Development Server URL or localhost.
4.3 Click on the Local Development Server URL while pressingctrl
. Displayed as:
http://localhost:XXXX/
4.4 This allows you to test and view your application in a browser before deploying it to a live server.
Conclusion: This whole process will land you on the home page of this project. Navigate to the Predict page, enter your details, and boom 💥 here is your answer or a prediction that you might have or not have a heart attack on the same health conditions.
The compilation of data is an essential stage in the logistic regression prediction of heart attacks. For the model to work well, preprocessing characteristics like age, blood pressure, and cholesterol levels is necessary. The prepared data is divided into training and testing sets to properly assess the model's performance. Subsequently, the model is trained using logistic regression to determine the correlation between these attributes and the risk of a heart attack. Metrics such as accuracy are computed to measure the model's predictive power after it has been trained on the test set. To enhance performance and develop a trustworthy heart attack prediction system, model modifications or feature engineering can be required.The logistic function is of the form: p(x)={1/1+e^{-(x )}
The Flask web framework is used in the creation of the web application. Either the physician or the patient can log in to the system, enter the patient's health information, and press the "predict" button. For prediction, the provided input is compared with the current model. The user is shown the outcome once the forecast has been completed.
- Frontend:
- Backend:
- Samarth Mishra - https://github.com/Samarth5101
- Shruti Gontia - https://github.com/Shruti5101
<----------------X--------------X------------X-------------X--------------X------------------->