A high-fidelity, interactive React dashboard for real-time stroke risk prediction using Explainable AI (XAI).
StrokeGuard AI is not just an ML model, it's a bridge between clinical intuition and algorithmic prediction. Built to combat the severe class imbalance of real-world stroke datasets, this system implements pre-trained Logistic Regression, Random Forest, and AdaBoost models.
Through an interactive frontend architecture, clinicians and users can visually dissect feature importances via SHAP-like waterfalls and dynamic risk contribution models.
Real-world medical datasets are massively skewed (our dataset has a 95.1% to 4.9% ratio of healthy to stroke patients). The Overview tab dynamically bridges the gap by visualizing the pre-processing pipeline, specifically highlighting how SMOTE (Synthetic Minority Over-sampling Technique) prevents the classifier from collapsing into an all-negative predictor.
A live competitive view of our classifier algorithms:
- Logistic Regression, AdaBoost, and Random Forest.
- Dynamically rendered Custom SVG ROC curves.
- Direct visual comparisons showing Test Area Under the Curve (AUC) vs. Cross-Validation AUC to detect data-leakage and overfitting.
The "black box" is opened using custom-built SVG SHAP beeswarm simulators and waterfall representations. Users can see mathematically why a patient was flagged:
- Top features Gini Importances.
- Percentage breakdown between actionable (Clinical, Lifestyle) and non-actionable (Demographic) variables.
Input patient biometrics in real-time and watch the live risk score update dynamically on a custom-designed Retro Dot-Matrix Display. The dashboard transforms the raw output probabilities back into actionable clinical language based on variable contributions.
The system is a fully client-side static web application designed for absolute zero-latency execution.
- Data Handling: All complex standardizations (Z-scores), categorical one-hot-encodings, and mathematical regressions (Sigmoid, Extrapolation) are executed smoothly inside pure JavaScript functional pipelines (
src/data.js). - Visuals: Zero raster images. Everything is drawn mathematically using CSS Grid matrices, dynamic Recharts parameters, and inline SVG manipulation.
Want to run the dashboard on your own machine? It takes less than 30 seconds:
# 1. Clone the repository
git clone https://github.com/YashwanthNavari/-Heart-Disease-Risk-Prediction-System.git
# 2. Enter the directory
cd -Heart-Disease-Risk-Prediction-System
# 3. Install NPM dependencies
npm install
# 4. Start the Vite development server
npm run devVisit http://localhost:5173 to explore the dashboard locally.