In this assignment, we created a web app based on a heart diease dataset and use machine learning algorithms to make predictions on important factors relevant to heart dieases.
Firstly, we divide our project into two part: backend and frontend. Secondly, we use Machine Learning - decision tree algorithm to make prediction. Then we use cross validation method to increase the accuracy of the prediction.
- Dataset Collection
- UI Design
- Machine Learning
- Optimization algorithm
- API Server
- Frontend
- Backend
- README.md
Dataset from http://www.cse.unsw.edu.au/~cs9321/19T1/assn/heart.tar.
- Convert data to csv format
- Drop Invalid Data
- Fill Missing Data By Median or Average
- Building decision tree model to make prediction
- As for decision tree classifier model,we used the information gain and entropy split criteria. We also calculated the accuracy of our decision tree model.
- Use Cross-validation method to improve accuracy of prediction
- Use K-means and PCA method to cluster features
- Frontend : Vanilla Javascript, JQuery, HTML, Materialize CSS
- Backend : Python (Flask), pandas, SQLite
- Machine Learning : Scikit-Learn
- Backend
$ cd backend
$ pip install -r requirements.txt
$ python3 app.py
WARNING: Backend URL must be at http://127.0.0.1:5000
- Frontend
$ npm install -g http-server
$ cd frontend
$ http-server
Open browser at http://localhost:8080
- Simply run predict.py and the model will be automatically generated