Skip to content

YashwanthNavari/-Heart-Disease-Risk-Prediction-System

Repository files navigation

Typing SVG

A high-fidelity, interactive React dashboard for real-time stroke risk prediction using Explainable AI (XAI).

Live Demo

React Vite Machine Learning JavaScript


🚀 Overview

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.


✨ System Architecture & Features

🔬 1. Dataset & SMOTE Imbalance Visualizer

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.

⚔️ 2. Model Arena

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.

🧠 3. Explainable AI (XAI) & SHAP

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.

🩺 4. Live Risk Predictor Engine

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.


🛠️ Technical Implementation

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.

💻 Getting Started Locally

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 dev

Visit http://localhost:5173 to explore the dashboard locally.


Built with ❤️ by Yashwanth Reddy | GitHub Profile

About

Develop a supervised machine learning model that predicts the presence of heart disease using patient medical parameters

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors