Spaces:
Sleeping
Sleeping
Commit
·
58f187a
1
Parent(s):
afe94ad
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,10 +13,10 @@ loaded_model = pickle.load(open("h22_xgb.pkl", 'rb'))
|
|
| 13 |
explainer = shap.Explainer(loaded_model) # PLEASE DO NOT CHANGE THIS.
|
| 14 |
|
| 15 |
# Create the main function for server
|
| 16 |
-
def main_func(
|
| 17 |
-
new_row = pd.DataFrame.from_dict({'
|
| 18 |
-
'
|
| 19 |
-
|
| 20 |
|
| 21 |
prob = loaded_model.predict_proba(new_row)
|
| 22 |
|
|
|
|
| 13 |
explainer = shap.Explainer(loaded_model) # PLEASE DO NOT CHANGE THIS.
|
| 14 |
|
| 15 |
# Create the main function for server
|
| 16 |
+
def main_func(age,sex,cp,trtbps,chol,fbs,restecg,thalachh,exng,oldpeak,slp,caa,thall,output):
|
| 17 |
+
new_row = pd.DataFrame.from_dict({'age':age,'sex':sex,'cp':cp,'trtbps':trtbps,'chol':chol,
|
| 18 |
+
'fbs':fbs,'restecg':restecg,'thalachh':thalachh,'exng':exng,'oldpeak':oldpeak,
|
| 19 |
+
'slp':slp,'caa':caa,'thall':thall,'output':output}, orient = 'index').transpose()
|
| 20 |
|
| 21 |
prob = loaded_model.predict_proba(new_row)
|
| 22 |
|