Heart Disease detection algorithm based upon the Kaggle Dataset on Heart Disease UCI.
There are a total of 14 columns, the columns are described as followed:
I have tried the work in four different machine learning models, i.e.
Among them RandomForestClassifier & LogisticRegression showed good cross validation accuracy and the standard deviations also less as compare to other two, and after further research I choose RandomForestClassifier as my final model. The hyper-parameters I used in the final model is:
final_model = RandomForestClassifier(n_estimators=60, random_state=9,
criterion='gini', max_features='sqrt',
max_samples=9)
The tree generated by the final model looks like:
Classification Report :
precision recall f1-score support
0 0.89 0.86 0.88 29
1 0.88 0.91 0.89 32
accuracy 0.89 61
macro avg 0.89 0.88 0.88 61
weighted avg 0.89 0.89 0.89 61
I have mentioned the Training Accuracy, Testing Accuracy, Sensitivity, Specificity and The AUC Score in the .ipynb
file!
The model has given an accuracy of 88.52% over the test dataset that is randomly generated by 20% of the main datset.
My model is based on neural network. Architecture of my model is the following:
Plain Text
Model: "sequential_UCI"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
dense_77 (Dense) (None, 16) 224
_________________________________________________________________
dropout_41 (Dropout) (None, 16) 0
_________________________________________________________________
dense_78 (Dense) (None, 8) 136
_________________________________________________________________
dropout_42 (Dropout) (None, 8) 0
_________________________________________________________________
dense_79 (Dense) (None, 1) 9
=================================================================
Total params: 369
Trainable params: 369
Non-trainable params: 0
_________________________________________________________________
Adam()
with learning rate 0.001Accuracy with several different NN