Analisis Perbandingan Algoritma Klasifikasi untuk Penyakit Jantung
Comparative Analysis Of Classification Algorithms For Heart Disease
Penyakit jantung menjadi penyebab tertinggi kematian di dunia setelah stroke. Dengan kemajuan teknologi yang sangat pesat mendorong berbagai penelitian untuk mempermudah dalam mendiagnosa penyakit jantung menggunakan klasifikasi machine learning. Model klasifikasi yang biasa digunakan antara lain Decision Tree, Naive Bayes dan Random Forest Classifier. Metode Decision Tree menggunakan pohon keputusan, metode Naïve Bayes menggunakan probabilitas disetiap data, sedangkan metode Random Forest Classifier menggunakan beberapa pohon keputusan yang disatukan. Data yang digunakan adalah Heart Attack Analysis & Prediction Dataset diambil dari Kaggle. Penelitian ini bertujuan untuk mencari model yang terbaik dalam mengklasifikasikan data penyakit jantung dari ketiga model tersebut. Untuk mendapatkan model yang terbaik penelitian ini melakukan cross validation pada setiap model machine learning. Dari hasil cross validation didapatkan adanya overfiting pada setiap model. Untuk mengatasi overfiting peneliti melakukan fine tuning pada setiap model dengan parameter F1-Score.
Berdasarkan pengujian, maka diperoleh hasil sebagai berikut : a). model decision tree menggunakan evaluasi random search mendapatkan nilai 0.844 dan grid search 0.84. b). model naïve bayes tidak ada perbedaan antara evaluasi menggunakan random search maupun grid search yaitu sebesar 0.85. Selanjutnya c). model random forest classifier menggunakan evaluasi random search yaitu 0.852 dan grid search yaitu 0.868. Dengan demikian model random forest classifier merupakan model terbaik dalam mengklasifikasi penyakit jantung menggunakan hyperparamter tuning.
Heart disease is the leading cause of death in the world after stroke. With very rapid technological advances, it encourages various studies to make it easier to diagnose heart disease using machine learning classification. Classification models commonly used include Decision Tree, Naive Bayes, and Random Forest Classifier. The Decision Tree method uses a decision tree, the Naïve Bayes method uses probabilities in each data, while the Random Forest Classifier method uses several unified decision trees. The data used is Heart Attack Analysis & Prediction Dataset taken from Kaggle. This study aims to find the best model for classifying heart disease data from the three models. To get the best model, this research conducted cross-validation on each machine learning model. From the results of cross-validation, it was found that there was overfitting in each model. To overcome the overfitting the researchers did fine tuning on each model with the F1-Score parameter. Based on the test, the following results are obtained: a). the decision tree model using a random search evaluation gets a value of 0.844 and a grid search of 0.84. b). In the Naïve Bayes model, there is no difference between evaluations using random search and grid search, which is 0.85. Next c). The random forest classifier model uses a random search evaluation of 0.852 and a grid search of 0.868. Thus the random forest classifier model is the best model in classifying heart disease using hyperparamter tuning.