Stroke is a leading cause of death and disability globally. This project aims to build an end-to-end Machine Learning pipeline to predict whether a patient is likely to get a stroke based on various health parameters like gender, age, medical conditions, and smoking status.
The project goes beyond just data analysis and model training; it includes deploying the best-performing model (.pkl file) via an interactive Streamlit Web Application, allowing users to input medical data and get real-time stroke predictions.
- Exploratory Data Analysis (EDA): Deep dive into patient data to uncover patterns and correlations using Pandas and Data Visualization libraries.
- Data Preprocessing: Handling missing values, encoding categorical variables, and scaling features for optimal model performance.
- Predictive Modeling: Training and evaluating various Machine Learning algorithms to find the most accurate model for stroke prediction.
- Interactive Web UI: A user-friendly Streamlit application that utilizes the trained model to make on-the-fly predictions.
Stroke_Prediction_Analysis/
├── healthcare-dataset-stroke-data.csv # Raw dataset
├── preprocessed_stroke_data.csv # Cleaned and processed dataset
├── ML Models For Stroke Predictions.ipynb # Jupyter Notebook containing EDA & Modeling
├── ML_Model_For_Stroke_predection.pkl # Serialized (trained) Machine Learning model
├── streamlit_app.py # Streamlit application script
└── README.md # Project documentation
To run this project locally, follow these steps:
1. Clone the repository
git clone [https://github.com/MahmoudAhmmed/Stroke_Prediction_Analysis.git](https://github.com/MahmoudAhmmed/Stroke_Prediction_Analysis.git)
cd Stroke_Prediction_Analysis2. Install required libraries Ensure you have Python installed, then run:
pip install pandas numpy scikit-learn streamlit3. Run the Streamlit Web App To launch the interactive application, run the following command in your terminal:
streamlit run streamlit_app.pyThe app will open automatically in your default web browser at http://localhost:8501.