{"id":23279951,"url":"https://github.com/jarvis843/stroke_prediction_ml_project","last_synced_at":"2025-08-21T12:31:25.958Z","repository":{"id":267758258,"uuid":"902211186","full_name":"JARVIS843/Stroke_Prediction_ML_Project","owner":"JARVIS843","description":"Various machine learning models that predict whether people of all age groups are going to have strokes.","archived":false,"fork":false,"pushed_at":"2024-12-19T12:18:37.000Z","size":2283,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-12-19T13:26:12.965Z","etag":null,"topics":["conda","conda-environment","jupyter-notebook","kaggle","machine-learning","mit-license","neural-network","python3","sklearn","tensorflow","tensorflow2"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/JARVIS843.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-12-12T06:02:41.000Z","updated_at":"2024-12-19T12:31:48.000Z","dependencies_parsed_at":"2024-12-12T09:24:05.759Z","dependency_job_id":"abcac672-8385-46ed-a882-11c8bc8a840c","html_url":"https://github.com/JARVIS843/Stroke_Prediction_ML_Project","commit_stats":null,"previous_names":["jarvis843/stroke_prediction_ml_project"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JARVIS843%2FStroke_Prediction_ML_Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JARVIS843%2FStroke_Prediction_ML_Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JARVIS843%2FStroke_Prediction_ML_Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JARVIS843%2FStroke_Prediction_ML_Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JARVIS843","download_url":"https://codeload.github.com/JARVIS843/Stroke_Prediction_ML_Project/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230512244,"owners_count":18237760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["conda","conda-environment","jupyter-notebook","kaggle","machine-learning","mit-license","neural-network","python3","sklearn","tensorflow","tensorflow2"],"created_at":"2024-12-19T23:19:47.526Z","updated_at":"2024-12-19T23:19:48.167Z","avatar_url":"https://github.com/JARVIS843.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Stroke Prediction using Machine Learning](https://github.com/JARVIS843/Stroke_Prediction_ML_Project)\n=========================================\n---\n## About:\n[This project](https://github.com/JARVIS843/Stroke_Prediction_ML_Project) aims to predict whether people across all age groups is likely to get strokes, based on eleven distinct features such as gender, age, and diseases etc. It trains various binary classification  [models](#models) using different methods, on Jupyter Notebook.\n\n--- \n## Installation Instructions:\n\n### Setup Conda Environment\nTo install / clone this project onto your machine, you should:\n\nRun the following command:\n```\nconda update conda\ngit clone https://github.com/JARVIS843/Stroke_Prediction_ML_Project.git\ncd Stroke_Prediction_ML_Project\nconda env create -f environment.yml\nconda activate StrokePredictionML\n```\n\nAdd the environment (StrokePredictionML) to Jupyter:\n```\npython -m ipykernel install --user --name=StrokePredictionML --display-name \"Python (StrokePredictionML)\"\n```\n\n(Optional): Confirm the kernel was added successfully:\n```\njupyter kernelspec list\n```\nYou would then need to manually select the kernel from the Jupyter Interface\n\n### Setup Tensorflow with CUDA (Only for [Neural Network Models](#neural-network-models))\nIt took me 2 hours to setup everything up correctly, so I decided to put the instructions here.\n\nSince this project relies on tensorflow 2.18.0, so **Windows Native WOULD NOT WORK!!!** (TF gave up its development since 2.11). However, WSL still does.\n\nBefore everything, you need to make sure you have installed the newest driver. If you are using Nvidia graphics card that supports CUDA 12.5, you need to make sure your driver version is at least 555.42.02 for Linux (NOT WSL), and 555.85 for Windows. You may manually download specific driver on Nvidia's website, but I recommend using [Nvidia Geforce Experience](https://www.nvidia.com/en-us/geforce/geforce-experience/download/). If you are using WSL2, then you only have to install the newest driver on Windows side, and **ABSOLUTELY, DO NOT INSTALL IT ON WSL LINUX**, as it will mess up everything.\n\nThen, according to [this](https://www.tensorflow.org/install/source?hl=en#gpu), install [CUDA 12.5](https://developer.nvidia.com/cuda-12-5-0-download-archive?target_os=Linux). Note, if you are using WLS2 Ubuntu, choose [WSL-Ubuntu](https://developer.nvidia.com/cuda-12-5-0-download-archive?target_os=Linux\u0026target_arch=x86_64\u0026Distribution=WSL-Ubuntu\u0026target_version=2.0) in the Distribution section (as the Ubuntu version includes driver and may mess up the driver installed on Windows). \nAfter installation, check your installation with:\n```\nnvcc --version\n```\nIf it's not found, then you have to add it to PATH with:\n```\nexport PATH=/usr/local/cuda-12.5/bin${PATH:+:${PATH}}\n```\n\n\nFinally, you need to install [cuDNN 9.3](https://developer.nvidia.com/cudnn-9-3-0-download-archive?target_os=Linux) and follow the instruction on the webpage.\n\nTo verify that you have done everything correctly, use the following code (not command) in your jupyter notebook, with the previously established environment and kernel (StrokePredictionML). If setup correctly, it should not be zero (unless your GPU does not support CUDA 12.5 to begin with)\n```\nimport tensorflow as tf\nprint(\"Num GPUs Available: \", len(tf.config.list_physical_devices('GPU')))\n```\n\nAnd you should be done. If you ever encounter any problems, please consult the following links, as they helped me a bunch when I'm doing this myself:\n* https://www.tensorflow.org/install/source?hl=en#gpu\n* https://www.tensorflow.org/install/pip#linux\n* https://www.tensorflow.org/install/pip#linux\n* https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/ (Windows, but again, Windows Native doesn't work)\n* https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html (Linux)\n* https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html\n\n\n---\n## Project Structure:\nThe project is divided into two parts: [Non-nerual-network models](#non-neural-network-models), and [Neural Network models](#neural-network-models)\n\n### Non-Neural-Network Models:\nThis part of the project is in [ML_project.ipynb](/ML_project.ipynb), and it's responsible for data clean up, data analysis, data preprocessing, and training a variety of models (Extra Trees Classifier, Gradient boosting, Random Forest, and XGboost). The accuracies of the models are displayed with visualized confusion matrices.\n\n### Neural Network Models:\nThis is the other part of the project, and can be found in [Neural_Network_Model.ipynb](/Neural_Network_Model.ipynb). In order to be consistent, it uses the same data clean up and preprocessing procedures. It employs a [tensorflow](https://www.tensorflow.org/) 6 layered neural network (5 hidden 1 output and specific specs can be found in [Models](/Models/)), and cross tests its accuracies with various optimizers (RMSprop, Nadam,and Adam), learning rates (0.01, 0.001,and 0.0001), batch sizes (32 ,and 64), as well as number of epochs (50 ,and 100). Adapted Learning Rate strategies are also attempted.\n\n\n\n\n\n---\n\n## Models:\n\nIf you would like to use our pre-trained models, or to see the performances of them, all of them can be found: [Here](./Models/)\n\n\n\n***Note:** The models are serialized and exported using [Pickle](https://docs.python.org/3/library/pickle.html)\n\n---\n## Dataset Used:\n\nAll of the models for this project are trained using the [Kaggle Stroke Prediction Dataset](https://www.kaggle.com/datasets/fedesoriano/stroke-prediction-dataset). \n\nIn the beginning of [ML_project.ipynb](./ML_project.ipynb), you are provided an option to use either the pre-downloaded dataset (downloaded on 12/13/2024) in [Dataset](./Dataset/), or to download the newest dataset from Kaggle if you are using Colab or Linux.\n\n---\n## Authors \u0026 Background:\n\nThis project is co-developed by: [Jarvis Yang](https://github.com/JARVIS843) (responsible for [Neural Network Model](#neural-network-models)), and [Jegyeong An](https://github.com/northbear99) (responsible for [Non-Neural-Network Models](#non-neural-network-models)).\n\nThe project was intended to be the final project for the [Introduction to Machine Learning](https://github.com/sdrangan/introml) course, provided by Professor [Sundeep Rangan](https://wireless.engineering.nyu.edu/sundeep-rangan/).\n\n---\n## License (MIT):\n\nSee License File\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjarvis843%2Fstroke_prediction_ml_project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjarvis843%2Fstroke_prediction_ml_project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjarvis843%2Fstroke_prediction_ml_project/lists"}