ranimeree commited on
Commit
f01e913
·
verified ·
1 Parent(s): 18d4389

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -35,8 +35,11 @@ def predict(gender, age, hypertension, ever_married, work_type, heart_disease, a
35
  # Convert the input into a pandas DataFrame
36
  input_df = pd.DataFrame([inputs], columns=input_labels)
37
 
 
 
 
38
  # Predict the stroke risk
39
- prediction = model.predict(model_input=input_df)[0]
40
 
41
  # Return the prediction
42
  result = "High Risk" if prediction == 1 else "Low Risk"
 
35
  # Convert the input into a pandas DataFrame
36
  input_df = pd.DataFrame([inputs], columns=input_labels)
37
 
38
+ # Create context with model_input
39
+ context = {'model_input': input_df}
40
+
41
  # Predict the stroke risk
42
+ prediction = model.predict(context=context)[0]
43
 
44
  # Return the prediction
45
  result = "High Risk" if prediction == 1 else "Low Risk"