File size: 747 Bytes
4e2b11c
ff570a2
4e2b11c
ff570a2
 
4e2b11c
4804740
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
title: SHAP_NLP_TKA
app_file: app.py
sdk: gradio
sdk_version: 5.47.2
---
🧠 How This Model Works

📌 Model
	•	TF-IDF converts clinical notes → numeric features
	•	Logistic Regression predicts 30-day readmission
	•	Produces probability + class label

📌 SHAP
	•	SHAP KernelExplainer works for text models
	•	Provides a force plot explaining:
	•	What words increased risk
	•	What words decreased risk
	•	Outputs SHAP HTML (works in Hugging Face)

📌 Example Words That Increase Risk
	•	“infection”
	•	“fever”
	•	“drainage”
	•	“swelling”
	•	“diabetes”
	•	“slow healing”

📌 Words That Lower Risk
	•	“no complications”
	•	“independent ambulation”
	•	“normal vitals”