AIMLdeepanshu commited on
Commit
a8a9418
·
verified ·
1 Parent(s): e0a5391

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import joblib
3
  import numpy as np
4
 
5
- # Load XGBoost model
6
  model = joblib.load("xgboost_model.pkl")
7
 
8
  # 🔧 Preprocessing Function
@@ -20,7 +20,10 @@ def preprocess(age, gender, bmi, smoking, alcohol, diabetes, hypertension, famil
20
  # 🧠 Prediction Function
21
  def predict_alzheimers(age, gender, bmi, smoking, alcohol, diabetes, hypertension, family_history, cognitive_score, apoe4):
22
  features = preprocess(age, gender, bmi, smoking, alcohol, diabetes, hypertension, family_history, cognitive_score, apoe4)
23
-
 
 
 
24
  # Predict probability of class 1 (positive)
25
  proba = model.predict_proba(features)[0][1]
26
  proba_percent = round(proba * 100, 2)
 
2
  import joblib
3
  import numpy as np
4
 
5
+ # Load trained model
6
  model = joblib.load("xgboost_model.pkl")
7
 
8
  # 🔧 Preprocessing Function
 
20
  # 🧠 Prediction Function
21
  def predict_alzheimers(age, gender, bmi, smoking, alcohol, diabetes, hypertension, family_history, cognitive_score, apoe4):
22
  features = preprocess(age, gender, bmi, smoking, alcohol, diabetes, hypertension, family_history, cognitive_score, apoe4)
23
+
24
+ # Debug: print features being sent to model
25
+ print("🛠️ Processed input sent to model:", features)
26
+
27
  # Predict probability of class 1 (positive)
28
  proba = model.predict_proba(features)[0][1]
29
  proba_percent = round(proba * 100, 2)