Example classifier for predicting heart disease is deployed using fastapi
.
About the dataset.
This dataset comes from: https://www.kaggle.com/datasets/johnsmith88/heart-disease-dataset/.
It contains 1025 rows and 12 features.
The column thal
is predicted, and the previous target
is removed.
About the problem.
The classifier is trained on the local machine (the environment for training the model is given by environment.yml), then deployed in a container using FastAPI.
The model is evaluated using its accuracy and the average F1-score.
Selected model.
All features are treated as numeric. The Random Forest classifier (50 estimators) is trained (folder Classification
)
and the trained model is saved to the folder app
. A container is built and deployed in the script app/script.sh
.
A test example is provided in the end of this script.
Results.
This relatively simple classifier achieves 99% accuracy on test set.
Feedback and additional questions.
All questions about the source code should be adressed to its author Alexandre Aksenov:
- GitHub: Alexandre-aksenov
- Email: [email protected]