Hybrid Method Optimization For Classifying Heart Disease Using Knn And Pca Algorithms Based On Web Streamlite

Authors

  • Khofiyatul Universitas Nurul Jadid Author
  • Moh Ainol Yaqin Universitas Nurul Jadid Author
  • Cahyuni Novia Universitas Nurul Jadid Author

Keywords:

Heart disease, KNN, PCA, classification, Streamlit

Abstract

Heart disease is one of the leading causes of death worldwide and often goes undetected early. This necessitates a decision support system capable of facilitating rapid and accurate diagnosis. This study aims to develop a heart disease classification system by combining two methods: K-Nearest Neighbors (KNN) and Principal Component Analysis (PCA), in a web-based application using Streamlit. PCA is used to reduce data dimensionality and eliminate less relevant features to improve classification efficiency and performance. Meanwhile, the KNN algorithm is used to determine the class (heart disease or not) based on the proximity of the new data to the labeled data. This study used the heart.csv dataset and was tested using several methods, including accuracy, classification reports, and confusion matrices. The test results showed that the hybrid PCA and KNN model was capable of providing relatively high accuracy and informative visualizations. The best accuracy rate achieved in this study reached 90%, demonstrating the model's effectiveness in classifying data. Using the Streamlit interface, this system is easily accessible and usable by users without requiring special installation. The conclusion of this study is that the combination of PCA and KNN is effective in classifying heart disease efficiently and accurately.

Downloads

Download data is not yet available.

Downloads

Published

2026-01-02