mertkarabacak commited on
Commit
cfa1f51
·
1 Parent(s): 3889122

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -143,7 +143,7 @@ def y1_predict_cb(*args):
143
  df_cb = pd.DataFrame([args], columns=x.columns)
144
  df_cb = df_cb.astype({col: "category" for col in categorical_columns})
145
  pos_pred = y1_model_cb.predict(Pool(df_cb, cat_features = categorical_columns), prediction_type='Probability')
146
- return {"Adverse Outcomes": float(pos_pred[0]), "No Adverse Outcomes": 1 - float(pos_pred[0])}
147
 
148
  def y1_predict_rf(*args):
149
  df = pd.DataFrame([args], columns=x_rf.columns)
@@ -151,7 +151,7 @@ def y1_predict_rf(*args):
151
  d = dict.fromkeys(df.select_dtypes(np.int64).columns, np.int32)
152
  df = df.astype(d)
153
  pos_pred = y1_model_rf.predict_proba(df)
154
- return {"Adverse Outcomes": float(pos_pred[0]), "No Adverse Outcomes": 1 - float(pos_pred[0])}
155
 
156
 
157
  #Define interpret for y1/AE.
 
143
  df_cb = pd.DataFrame([args], columns=x.columns)
144
  df_cb = df_cb.astype({col: "category" for col in categorical_columns})
145
  pos_pred = y1_model_cb.predict(Pool(df_cb, cat_features = categorical_columns), prediction_type='Probability')
146
+ return {"Adverse Outcomes": float(pos_pred[0][1]), "No Adverse Outcomes": float(pos_pred[0][0])}
147
 
148
  def y1_predict_rf(*args):
149
  df = pd.DataFrame([args], columns=x_rf.columns)
 
151
  d = dict.fromkeys(df.select_dtypes(np.int64).columns, np.int32)
152
  df = df.astype(d)
153
  pos_pred = y1_model_rf.predict_proba(df)
154
+ return {"Adverse Outcomes": float(pos_pred[0][1]), "No Adverse Outcomes": float(pos_pred[0][0])}
155
 
156
 
157
  #Define interpret for y1/AE.