Inspiration
Cardiovascular diseases (which often leads to heart failures) are the number 1 cause of death globally, taking an estimated 17.9 million lives each year, which accounts for 31% of global deaths. his machine learning model could help in estimating the probability of deaths caused by heart failure by taking in important features from the dataset and making predictions based on these features.
What it does
There is a machine learning model that deploy locally using python flask web framework, basically the web UI take four basic thnigs that is the age of the patient, Ejection fraction, Serum creatininSerum, Serum sodium and after input those values the API gives those inputs to machine learning model. And after analyzing that inputs. And then the model send the predicted result to the API and the actual result show in the UI that is the patient is likely to be a heart disease patient or not.
How we built it
Here the dataset consists of 12 variables/features, and 1 output variable/target variable Age, Anemia, Creatinine_phosphokinase, Diabetes, Ejection fraction, High blood pressure, Platelets, Serum creatininSerum, Serum sodium, Gender.
First, I explored the importance of the Age feature in determining If a patient is likely to have a heart failure or not. we can see that as the age increases, the probability of a death event also increases Also, since the increase in one variable results in an increase in the other variable, we can deduce that these two variables are positively correlated. However, a correlation matrix will still be plotted for confirmation.
In general, the normal creatinine levels range from 0.9–1.3, and from the distribution of serum_creatinine against Death_event. The reference range for serum sodium is between 135–147 mmol/L. From the visualization, the survival rate only starts to increase at this range. This feature also has a considerable correlation with Death_Event.
After splitting tranning and testing data we have to process those data. This brings the data to a state that the model can parse easily. For the purpose of this project, the Standard Scaler is used, which standardizes the features by subtracting the mean and then scaling to unit variance.
The support vector machine (SVM), a supervised machine learning model that uses classification algorithms for two-group classification problems is used. After giving the SVM model sets of the preprocessed training data for each category, they’re able to categorize new output. The classification report shows an overall accuracy of 75%.
Since this model will be deployed, it is saved into a pickle(Pickle is a python module that enables python objects to be written to files on the disk and read back into the python program runtime.) file (model.pkl) created by pickle, and this file will reflect in your project folder.
In deploying this heart failure prediction model into production, a web application framework called Flask is used. Flask makes it easy to write applications, and also gives a variety of choices for developing web applications.
Challenges we ran into
The main challenging factor of this project to find a appropiate dataset because we working with machine learing model. But fortunately kaggle made our work easy.
API management while deploing the application on python flask framework.
What we learned
A brief of svm supervised machine learning model
Data management like data cleaning, train and split the data that make a dataset more unique that is important to achieve perfect accueracy.
Build python API using python flask web framework
I learn about how to Integrate a simple UI with a machine learing model deploy it.
What's next for ML_HEART_DISEASE_PREDICTION
As we all see the disease accuracy is still 75% by use svf model. So we focused on accuracy and apply a best machine learning algorithm to increase the accuracy and also make the model more unique.
The next thing is to deploy the application globally so that the application is accessable for every end users and vendors.
Built With
- css
- flask
- html
- jupyternotebook
- machine-learning
- python



Log in or sign up for Devpost to join the conversation.