This is a simple Flask web application for predicting the likelihood of heart disease based on user input. The application uses a pre-trained machine learning model that combines Support Vector Machine (SVM) and Random Forest classifiers. The model was trained on a dataset available in 'new_g40.csv'.
-
Clone the repository: git clone - https://github.com/shubhankardutta38/Heart_Disease_Prediction_Using_Python.git
-
Navigate to the project directory: cd heart-disease-prediction
-
Install the required dependencies
- Ensure that you have Python and Flask installed on your system.
- Run the Flask application: python main.py
- Open your web browser and go to http://127.0.0.1:5000
- Fill out the form with the required information, and click the "Predict" button to get the prediction result.
main.py: The main Flask application file containing the web server logic. templates/index.html: HTML template for the home page and prediction result display. new_g40.csv: Dataset used for training the machine learning model. Voting_Classifier_(SVM + Random Forest)_model_data_c1.pkl: Pre-trained machine learning model saved using joblib.
- Flask
- pandas
- joblib
The application uses a combination of Support Vector Machine (SVM) and Random Forest classifiers for predicting heart disease. The model is loaded from the 'Voting_Classifier_(SVM + Random Forest)_model_data_c1.pkl' file.
- Age Category
- Sex
- BMI (Body Mass Index)
- Smoking
- Alcohol Drinking
- Stroke
- Physical Health
- Mental Health
- Difficulty Walking
- Diabetic
- Physical Activity
- General Health
- Sleep Time
- Asthma
- Kidney Disease
- Skin Cancer
![Screenshot 2023-12-28 at 8 22 55 PM](https://private-user-images.githubusercontent.com/129721532/293226891-7b9eeec2-9472-4c15-b402-e4efb091e9e7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE4NDQwOTQsIm5iZiI6MTcyMTg0Mzc5NCwicGF0aCI6Ii8xMjk3MjE1MzIvMjkzMjI2ODkxLTdiOWVlZWMyLTk0NzItNGMxNS1iNDAyLWU0ZWZiMDkxZTllNy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0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