Inspiration
I recently read online that in the United States, someone has a heart attack approximately every 40 seconds. The disproportionately large number of people suffering from heart-related diseases shocked me, and I was inspired to work on a project that could potentially help a person at risk of having a heart attack or some other heart-related disease. At the same time, I was motivated to apply my knowledge of machine learning to a practical, real-world problem and to integrate it with a easily-accessible web application.
What it does
The user inputs 13 variables (age, gender, cholesterol level, etc) into the UI, and a machine learning model that I trained and developed predicts whether or not the patient is at risk of contracting heart disease. The web application also provides additional information about how to reduce risk of heart disease. The data that the user inputs is confidential - it is not stored anywhere to be reused.
How I built it
I built the application using Python, HTML, CSS, and Javascript. I found heart disease data online that was collected by the Long Beach and Cleveland Clinic Foundation. I then used the pandas and numpy library in Python to preprocess the data. I used this clean data to train and test 6 different machine learning algorithms found in python's scikit-learn library: Logistic Regression, Linear Discriminant Analysis, K-Nearest Neighbors Classifier, Decision Tree Classifier, Support Vector Machine (SVM), and Gaussian Naive Bayes Classifier. Upon evaluation, the Gaussian Naive Bayes algorithm achieved the highest diagnostic performance at approximately 90% accuracy. I then used the Flask web-framework library in python to host the trained machine learning model. I developed the website using HTML, CSS, and Javascript.
Challenges I ran into
The heart disease dataset that I found online had several missing entries/missing values. I had difficulty preprocessing the data. To preprocess it, I replaced each missing value in a column with the mean of the other values of that column. Another difficulty I ran into was sending form data from the user to a format that the machine learning model can predict on.preprocessing the data.
Accomplishments that I'm proud of
I am proud that I figured out how to properly process the missing data so that I would be able to train my models. I am proud of developing a simple machine learning algorithm that is capable of diagnosing risk for heart disease with nearly 90% accuracy. This model can hopefully help to reliably diagnose whether or not a patient is at risk and can potentially save someone’s life.
What I learned
I learned how to integrate Flask with machine learning.
What's next for Heart Disease Diagnostic Application
Next, I plan on using deep neural networks to improve diagnostic accuracy. I can use PyTorch or Keras to implement these neural networks. In addition, I think that using a react framework would result in a more simplistic and user-friendly interface, so I will also implement that in the future.
Log in or sign up for Devpost to join the conversation.