Heart Disease Prediction System (HDPS) is a web-based Machine Learning Project with a user-friendly interface that is built with Django. It predicts whether the patient has heart disease or not using Machine Learning (ML) Algorithm Logistic Regression.
For HDPS Demonstration follow this video
HDPS Project Demonstration Video
For Explanation of HDPS follow this video
HDPS Project Explanation Video
To train the model, the Machine Learning algorithm Logistic Regression is used. You can easily import Logistic Regression from scikit-learn library, but the project has implemented Logistic Regression right from scratch.
Logistic regression is a supervised learning classification algorithm used for predicting the categorical dependent variable using a given set of independent variables.
Logistic regression predicts the output of a categorical dependent variable. Therefore the outcome must be a categorical or discrete value. It can be either Yes or No, 0 or 1, true or False, etc. but instead of giving the exact value as 0 and 1, it gives the probabilistic values which lie between 0 and 1
Logistic regression basic concept
In HDPS data is extracted from the patient which includes different 13 parameters like blood pressure, age, sex, etc. This data is then fed to the trained model which provides the outcome in the form of probability ranging value 0-1.
13 different attributes include :
13 different attributes of HDPS
For source code please refer to this GitHub Repo.
All Machine Learning algorithm needs training to predict the result. Firstly, the model is trained with data set, which was collected from the Kaggle UCI repository. After training our model the model now becomes ready to take input and process it.
Process Design of HDPS
The input is given to the trained model. The model classifies data based on probability, a value greater than 0.5 is considered to have a high probability of heart disease, and a value less than 0.5 has less probability of having heart disease. The result is then displayed to the user.
The accuracy of a system is given by the number of correct predictions by the total number of predictions made multiplied by 100.
The accuracy of HDPS is 71.287% which is not that high due to the low number of datasets and implementation of the algorithm from scratch.
Accuracy of Heart Disease Prediction System (HDPS)
True Positive: True Positive are those examples that were actually positives and were predicted as positives. True Positive of our model was 29.
False Positive: False Positives also known as Type 1 error are those examples that were actually negatives but our model predicted them as positive. False Positive of our model was 6.
False Negative: False Negatives also known as Type 2 error are those examples that were actually positives but our model predicted them as negative. False Negative of our model was 23.