GK SOLUTIONS
AI โ€ข IoT โ€ข Arduino โ€ข Projects & Tutorials
DEFEAT THE FEAR

Heart Disease Detection Naive Bayes

No description available

๐Ÿ“Š Difficulty: Beginner
โฑ๏ธ Varies
โญ 0 stars
๐Ÿด 0 forks

๐Ÿ› ๏ธ Technologies Used

HTML Python Python scikit-learn pandas Flask HTML NumPy
# Heart-disease-detection-naive-bayesian ๐Ÿ“Œ Project Overview Heart disease is one of the leading causes of death worldwide. Early prediction and diagnosis can significantly reduce mortality rates and improve patient outcomes. This project focuses on the design and implementation of a Heart Disease Prediction System using the Naive Bayes algorithm. The system analyzes patient health parameters and predicts whether a person is likely to have heart disease. It provides both command-line and web-based interfaces, making it easy to use for healthcare applications. ๐ŸŽฏ Objectives To predict heart disease using machine learning techniques To implement the Naive Bayes classifier for medical data analysis To develop a user-friendly web interface for prediction To assist doctors and patients in early diagnosis To achieve reliable prediction accuracy with minimal computational cost ๐Ÿง  Technology Stack Programming Language: Python Machine Learning Algorithm: Naive Bayes (GaussianNB) Web Framework: Flask Libraries Used: pandas numpy scikit-learn flask Frontend: HTML, CSS Dataset: Heart disease medical dataset โš™๏ธ System Architecture The system consists of the following modules: Data Generation Module Model Training Module Prediction Module (CLI & Web) Web Interface Module Visualization Module (Histogram / Graphs) ๐Ÿ“‚ Project Structure Heart-Disease-Prediction/ โ”‚ โ”œโ”€โ”€ data/ โ”‚ โ””โ”€โ”€ heart_disease_data.csv โ”‚ โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ app.py โ”‚ โ”œโ”€โ”€ train_model.py โ”‚ โ”œโ”€โ”€ predict.py โ”‚ โ”œโ”€โ”€ generate_data.py โ”‚ โ”œโ”€โ”€ heart_disease_model.pkl โ”‚ โ”œโ”€โ”€ templates/ โ”‚ โ””โ”€โ”€ result.html โ”‚ โ”œโ”€โ”€ static/ โ”‚ โ””โ”€โ”€ styles.css โ”‚ โ”œโ”€โ”€ verify_histogram.py โ”œโ”€โ”€ requirements.txt โ””โ”€โ”€ README.md ๐Ÿงช Methodology Data Collection Medical data containing patient health attributes is collected. Data Preprocessing Data is cleaned and prepared for training. Model Training A Gaussian Naive Bayes classifier is trained using Scikit-learn. Prediction The trained model predicts the likelihood of heart disease. Result Visualization Prediction confidence and population comparison are displayed graphically. โ–ถ๏ธ How to Run the Project 1๏ธโƒฃ Install Dependencies pip install -r requirements.txt 2๏ธโƒฃ Generate Dataset (Optional) python src/generate_data.py This creates: data/heart_disease_data.csv 3๏ธโƒฃ Train the Model python src/train_model.py Trains the Naive Bayes model Displays accuracy Saves the model as: src/heart_disease_model.pkl 4๏ธโƒฃ Run Prediction (Command Line) python src/predict.py Enter patient details when prompted Get heart disease prediction instantly 5๏ธโƒฃ Run Web Application python src/app.py Open browser and visit: http://127.0.0.1:5000 Enter health parameters View prediction result See confidence percentage and histogram ๐Ÿ“Š Output Screens Prediction Result Page Likely Heart Disease / No Heart Disease Confidence Percentage Population Comparison Graph โœ… Advantages Simple and efficient algorithm High prediction accuracy Low computational complexity User-friendly interface Suitable for real-time healthcare applications โš ๏ธ Limitations Depends on quality of dataset Assumes independence between features Performance may vary with unseen data ๐Ÿš€ Future Enhancements Integration with real-time hospital databases Use of hybrid machine learning models Mobile application support Cloud-based deployment Integration with wearable health devices ๐Ÿ“š Conclusion This project successfully demonstrates the application of Naive Bayes classification in predicting heart disease. The system provides an effective decision-support tool for early diagnosis and healthcare assistance. With further enhancements, it can be deployed in real-world medical environments. ๐Ÿ‘ฉโ€๐Ÿ’ป Developed By Design and Implementing Heart Disease Prediction Using Naive Bayesian Major Project โ€“ Artificial Intelligence and Machine Learning