{"id":25824221,"url":"https://github.com/aaa1928/heart-disease-ml-classifier","last_synced_at":"2026-04-14T18:33:32.016Z","repository":{"id":278865954,"uuid":"937003368","full_name":"aAa1928/heart-disease-ml-classifier","owner":"aAa1928","description":"A PyTorch model with a 99.27% accuracy designed to predict the risk of heart disease based on a combination of symptoms, lifestyle factors, and medical history from 70,000+ data samples.","archived":false,"fork":false,"pushed_at":"2025-02-22T07:51:19.000Z","size":2626,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T08:44:46.150Z","etag":null,"topics":["classification","healthcare","heart-disease","heart-disease-detection","heart-disease-prediction","machine-learning","neural-network","python","pytorch","tabular","tabular-data"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aAa1928.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-22T05:18:47.000Z","updated_at":"2025-03-08T21:24:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"4ef1da3b-6560-4c3c-8ec4-66a75b63b7ef","html_url":"https://github.com/aAa1928/heart-disease-ml-classifier","commit_stats":null,"previous_names":["aaa1928/heart-disease-ml-classifier"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aAa1928/heart-disease-ml-classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aAa1928%2Fheart-disease-ml-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aAa1928%2Fheart-disease-ml-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aAa1928%2Fheart-disease-ml-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aAa1928%2Fheart-disease-ml-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aAa1928","download_url":"https://codeload.github.com/aAa1928/heart-disease-ml-classifier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aAa1928%2Fheart-disease-ml-classifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31810737,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["classification","healthcare","heart-disease","heart-disease-detection","heart-disease-prediction","machine-learning","neural-network","python","pytorch","tabular","tabular-data"],"created_at":"2025-02-28T12:37:27.470Z","updated_at":"2026-04-14T18:33:31.999Z","avatar_url":"https://github.com/aAa1928.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# heart-disease-ml-classifier\n\nA PyTorch model designed to predict the risk of heart disease based on a combination of symptoms, lifestyle factors, and medical history from 70,000+ data samples.\nThe model achieves approximately 99.27% accuracy on test data.\n\n[Download the model here](heart_disease_classifier_model.pth)\n\n[Kaggle Dataset link](https://www.kaggle.com/datasets/mahatiratusher/heart-disease-risk-prediction-dataset)\n\n## Overview\n\nThis project uses PyTorch to build a neural network classifier for heart disease risk prediction. The model analyzes several medical predictor variables to determine if a patient is at risk of heart disease.\n\n## Dataset\n\nThe dataset contains medical predictor variables from the heart_disease_risk_dataset_earlymed.csv file.\n\nIt contains 18 medical predictors of heart disease:\n\n1. Chest Pain: Presence of chest pain (Yes/No)\n2. Shortness of Breath: Difficulty breathing (Yes/No)\n3. Fatigue: Feeling of tiredness (Yes/No)\n4. Palpitations: Irregular heartbeat sensations (Yes/No)\n5. Dizziness: Feeling lightheaded (Yes/No)\n6. Swelling: Edema in extremities (Yes/No)\n7. Pain Arms Jaw Back: Pain radiating to arms/jaw/back (Yes/No)\n8. Cold Sweats Nausea: Presence of cold sweats or nausea (Yes/No)\n9. High BP: High blood pressure diagnosis (Yes/No)\n10. High Cholesterol: High cholesterol diagnosis (Yes/No)\n11. Diabetes: Presence of diabetes (Yes/No)\n12. Smoking: Current smoking status (Yes/No)\n13. Obesity: Obesity status (Yes/No)\n14. Sedentary Lifestyle: Physical inactivity (Yes/No)\n15. Family History: Family history of heart disease (Yes/No)\n16. Chronic Stress: Ongoing stress condition (Yes/No)\n17. Gender: Patient's gender (Male/Female)\n18. Age: Age of patient in years\n\nOutput variable:\n\n- Risk: Risk of Heart Disease (low/high)\n\n## Requirements\n\n- Python 3.8+\n- PyTorch\n- pandas\n- scikit-learn\n- matplotlib\n\n## Usage\n\n1. Clone the repository\n2. Create a virtual environment `py -m venv .venv` and activate it `.venv/Scripts/activate`\n3. Install dependencies: `pip install -r requirements.txt`\n4. Run the model: `python main.py`\n\n## Model Architecture\n\n- Input layer: 18 features\n- Hidden layer 1: 64 neurons with ReLU activation\n- Hidden layer 2: 28 neurons with ReLU activation\n- Output layer: 2 neurons (Binary classification)\n- Optimization: Adam optimizer with learning rate 0.005\n- Loss function: Cross Entropy Loss\n\n## Results\n\nThe model is trained for 1000 epochs and the training progress is visualized through a loss plot that is automatically generated and saved as 'loss_plot.png'.\nThe model achieves approximately 99.27% accuracy on the test set, with results being reproducible using a fixed random seed (392).\n\n## Model Persistence\n\nThe trained model is saved to 'heart_disease_classifier_model.pth' for later use.\n\n## License\n\n[MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaa1928%2Fheart-disease-ml-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaa1928%2Fheart-disease-ml-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaa1928%2Fheart-disease-ml-classifier/lists"}