Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heartattack Prediction Via Machine Learning Algorithm #751

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MithanshuHedau
Copy link

Pull Request for PyVerse 💡

Requesting to submit a pull request to the PyVerse repository.


issue : #727

Issue Title

Please enter the title of the issue related to your pull request.
Heartattack Prediction Via Machine Learning Algorithm

  • [✅ ] I have provided the issue title.

Info about the Related Issue

What's the goal of the project?
To develop a predictive model that accurately identifies individuals at risk of heart attack based on various health parameters using machine learning techniques. The model aims to assist healthcare professionals in early detection and preventive measures to reduce heart attack incidence and improve patient outcomes.

Aim :
The Heart Attack Prediction project is designed to create a machine learning-based solution capable of predicting the likelihood of an individual experiencing a heart attack based on health data and medical history. Cardiovascular diseases, particularly heart attacks, are one of the leading causes of death globally. Early prediction of heart attack risk can help in timely medical intervention and reduce mortality rates.

This project leverages a dataset containing various health metrics such as:

  • Age
  • Gender
  • Blood pressure levels (BP)
  • Cholesterol levels
  • Resting heart rate
  • Diabetes status
  • Smoking habits
  • Exercise-induced angina
  • Previous heart conditions
  • Electrocardiogram results (ECG)
  • Body mass index (BMI)
  • Physical activity levels

By analyzing these factors, the project aims to build a predictive model using machine learning algorithms like Logistic Regression, Decision Trees, Random Forest, and Artificial Neural Networks (ANN).

  • [✅] I have described the aim of the project.

Name

Please mention your name.
Mithanshu Rajesh Hedau.

  • [✅ ] I have provided my name.

GitHub ID

Please mention your GitHub ID.
MithanshuHedau

  • [✅ ] I have provided my GitHub ID.

Email ID

Please mention your email ID for further communication.
[email protected]

  • [ ✅] I have provided my email ID.

Identify Yourself

Mention in which program you are contributing (e.g., WoB, GSSOC, SSOC, SWOC).
gssoc-ext , hacktoberfest

  • [✅ ] I have mentioned my participant role.

Closes

Enter the issue number that will be closed through this PR.
Closes : #727

  • [✅ ] I have provided the issue number.

Describe the Add-ons or Changes You've Made

Give a clear description of what you have added or modified.
Added the ipynb file contains the wheteher the person suffer from heart attact prediction or not . and also add Readme file for clear understanding about what my file contains about it

  • [✅ ] I have described my changes.

Type of Change

Select the type of change:

  • [ ✅] New feature (non-breaking change which adds functionality)
  • [ ✅] This change requires a documentation update

How Has This Been Tested?

Describe how your changes have been tested.
The Heart Attack Prediction project has undergone a comprehensive testing process to ensure the accuracy and reliability of the models. The testing process includes the following steps:

Data Splitting: The dataset was divided into training and testing sets, typically using a ratio of 80:20 or 70:30. This allows for training the model on one portion of the data and evaluating it on unseen data to assess performance.

Cross-Validation: K-Fold cross-validation was employed to evaluate the models. The dataset was split into K subsets, and the model was trained K times, each time using a different subset for validation and the remaining for training. This helps to mitigate overfitting and provides a more robust estimate of model performance.

Hyperparameter Tuning: Various hyperparameters for each model were tuned using techniques like Grid Search or Random Search to identify the best combinations that yield optimal performance.

Performance Metrics: After training and validating the models, key performance metrics were calculated, including:

Accuracy: The proportion of correct predictions made by the model.
Precision: The proportion of positive identifications that were actually correct.
Recall (Sensitivity): The proportion of actual positives correctly identified.
F1-Score: The harmonic mean of precision and recall, providing a balance between the two.
ROC-AUC: The area under the Receiver Operating Characteristic curve, which indicates the model's ability to distinguish between classes.
Error Analysis: Misclassifications were analyzed to understand which types of cases the model struggled with, guiding further improvements in feature engineering or model selection.

Comparison of Models: The performance of different models was compared to identify the most effective one for predicting heart attack risk. The best-performing model was selected for deployment based on its accuracy and reliability.

Real-World Validation: If possible, the model's predictions were validated with real-world data or feedback from healthcare professionals to ensure practical applicability.

  • [✅ ] I have described my testing process.

Checklist

Please confirm the following:

  • [✅ ] My code follows the guidelines of this project.
  • [✅ ] I have performed a self-review of my own code.
  • [ ✅] I have commented my code, particularly wherever it was hard to understand.
  • [ ✅] I have made corresponding changes to the documentation.
  • [ ✅] My changes generate no new warnings.
  • [ ✅] I have added things that prove my fix is effective or that my feature works.
  • [✅ ] Any dependent changes have been merged and published in downstream modules.

Copy link

👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!

Feel free to join our community on Discord to discuss more!

@UTSAVS26 UTSAVS26 added Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. Status: Review Ongoing PR is currently under review and awaiting feedback from reviewers. level1 gssoc-ext hacktoberfest labels Oct 21, 2024
"import seaborn as sns\n",
"\n",
"# Load the dataset\n",
"data = pd.read_csv('heart_attack_prediction_dataset.csv')"
Copy link
Collaborator

@ruhi47 ruhi47 Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! But please provide either .csv file of the dataset in the directory or steps to read the dataset from Kaggle in the README.md file.
After that will merge the changes.

@ruhi47 ruhi47 added the Status: Requested Changes Indicates that a reviewer has requested changes to a PR before it can be approved. label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributor Denotes issues or PRs submitted by contributors to acknowledge their participation. gssoc-ext hacktoberfest level1 Status: Requested Changes Indicates that a reviewer has requested changes to a PR before it can be approved. Status: Review Ongoing PR is currently under review and awaiting feedback from reviewers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants