Enter The Input Features Correctly

Results from The Model

1 = Likely to have stroke
0 = Not likely to have Stroke


Brain Stroke

A brain stroke, also known simply as a stroke, occurs when the blood supply to a part of the brain is interrupted or reduced, preventing brain tissue from getting the oxygen and nutrients it needs. Without immediate medical attention, brain cells begin to die within minutes. There are two main types of strokes: Ischemic Stroke(This is the most common type, accounting for about 87% of all strokes. It occurs when a blood clot blocks or narrows a blood vessel in the brain.) Hemorrhagic Stroke(This occurs when a weakened blood vessel in the brain ruptures and bleeds into the surrounding tissue.)
Risk Factors
Several factors increase stroke risk:
1. High blood pressure
2. Diabetes
3. Smoking
4. High cholesterol
5. Obesity
6. Sedentary lifestyle
7. Family history of stroke

About This Project

This is a demo project demonstrating the use of machine learning for predicting stroke risk. The dataset used in this project is collected from Kaggle. The model used for prediction here is Logistic Regression. Among several models such as Logistic Regression, Decision Tree, Support Vector Machine, Random Forest, K-Nearest Neighbor, Naive Bayes, LightGBM, XGBoost, the logistic regression model performed best. The dataset was imbalanced, So we used a popular oversampling method called SMOTE to reduce that effect and trained our models with the new balanced dataset. After that Logistic Regression outperformed all the models. If you are interested please visit this link to see the full analysis.
Github link


Preformatted


          try {
            // Send POST request to backend
            const response = await fetch('https://portfolio-*****/predict', {
              method: 'POST',
              headers: { 'Content-Type': 'application/json' },
              body: JSON.stringify(inputData)
            });
    
            const data = await response.json();
            // Hide spinner when response is received
            document.getElementById('spinner').style.display = 'none';
            // Show result
            if (data.prediction !== undefined) {
              document.getElementById('result').innerText = "PREDICTION: " + data.prediction;
            } else {
              document.getElementById('result').innerText = "Error: " + data.error;
            }
    
          } catch (err) {
            document.getElementById('result').innerText = "Error: Could not connect to backend.";
          }