Skip to content

This project focuses on predicting heart disease using the K-Nearest Neighbors (KNN) classification algorithm implemented in a Jupyter Notebook. It aims to provide a tool that can assist in early detection and diagnosis of heart disease based on given input features.

Notifications You must be signed in to change notification settings

shaadclt/Heart-Disease-Prediction-KNN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Heart Disease Prediction using K-Nearest Neighbors (KNN) Classifier

This project focuses on predicting heart disease using the K-Nearest Neighbors (KNN) classification algorithm implemented in a Jupyter Notebook. It aims to provide a tool that can assist in early detection and diagnosis of heart disease based on given input features.

Features

  • Heart Disease Prediction: The project utilizes a KNN classifier to predict the presence or absence of heart disease based on several input features.
  • K-Nearest Neighbors Algorithm: The KNN algorithm is employed to classify the target variable by finding the k-nearest data points in the training set.
  • Feature Selection: Relevant features such as age, sex, chest pain type, resting blood pressure, cholesterol levels, and other medical attributes are considered to make accurate predictions.
  • Model Evaluation: The project incorporates evaluation metrics such as accuracy, precision, recall, and F1-score to assess the performance of the trained KNN model.

Dataset

The project employs a heart disease dataset that includes various attributes such as age, sex, chest pain type, blood pressure, cholesterol levels, and other relevant information. The dataset is divided into a training set and a test set, enabling the model to learn from the training set and evaluate its performance on unseen data.

Prerequisites

To run the Jupyter Notebook and execute the heart disease prediction code, you need to have the following dependencies installed:

  • Jupyter Notebook
  • Python libraries: NumPy, Pandas, scikit-learn, Matplotlib, Seaborn

Installation

To run the Heart Disease Prediction project in a Jupyter Notebook on your local machine, follow these steps:

  1. Clone the repository:
git clone https://github.com/your-username/heart-disease-prediction.git
  1. Navigate to the project directory:
cd heart-disease-prediction
  1. Install the required dependencies:

  2. Start the Jupyter Notebook:

jupyter notebook
  1. Open the Heart Disease Prediction.ipynb file in the Jupyter Notebook interface.

  2. Follow the instructions provided in the notebook to execute the code cells and run the heart disease prediction.

Customization

You can customize the Heart Disease Prediction project according to your specific requirements. Here are a few suggestions:

  • Feature Engineering: Explore additional feature engineering techniques or domain-specific knowledge to enhance the predictive power of the model.
  • Model Tuning: Experiment with different values of k (number of neighbors) and distance metrics to optimize the KNN model's performance.
  • Algorithm Selection: Try using alternative classification algorithms such as decision trees, random forests, or support vector machines to compare their performance against the KNN algorithm.
  • Visualization: Customize the visualizations in the notebook to present the results in a more informative and visually appealing manner.

Contribution

Contributions to the Heart Disease Prediction project are welcome. If you encounter any issues, have suggestions for improvements, or would like to contribute code, please follow these steps:

  1. Fork the repository.
  2. Create a new branch.
  3. Make your changes and commit them.
  4. Push your changes to your forked repository.
  5. Open a pull request in the original repository.

License

This project is licensed under the MIT License.

Acknowledgments

The Heart Disease Prediction project utilizes a heart disease dataset sourced from UCI Machine Learning Repository. We would like to express our gratitude to the contributors and researchers involved in curating and maintaining the dataset.

The implementation of the KNN classifier is based on the scikit-learn library, which provides a powerful and intuitive machine learning framework in Python. We would like to thank the scikit-learn community for their valuable contributions.

About

This project focuses on predicting heart disease using the K-Nearest Neighbors (KNN) classification algorithm implemented in a Jupyter Notebook. It aims to provide a tool that can assist in early detection and diagnosis of heart disease based on given input features.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published