Spaces:
Sleeping
Sleeping
hackerbyhobby
commited on
updated app with print statements for debugging
Browse files
app.py
CHANGED
@@ -37,11 +37,15 @@ def predict_heart_failure(age_category, alcohol_drinkers, chest_scan, covid_posi
|
|
37 |
if feature not in input_df.columns:
|
38 |
input_df[feature] = 0 # Fill missing features with default value (e.g., 0)
|
39 |
|
|
|
|
|
|
|
40 |
# Ensure no extra features are included
|
41 |
input_df = input_df[feature_names]
|
42 |
|
43 |
# Make a prediction
|
44 |
prediction = model.predict(input_df)[0]
|
|
|
45 |
return "High likelihood of heart failure" if prediction == 1 else "Low likelihood of heart failure"
|
46 |
|
47 |
# Define Gradio inputs
|
|
|
37 |
if feature not in input_df.columns:
|
38 |
input_df[feature] = 0 # Fill missing features with default value (e.g., 0)
|
39 |
|
40 |
+
print("Inputs received in the app:")
|
41 |
+
print(input_df)
|
42 |
+
|
43 |
# Ensure no extra features are included
|
44 |
input_df = input_df[feature_names]
|
45 |
|
46 |
# Make a prediction
|
47 |
prediction = model.predict(input_df)[0]
|
48 |
+
print(f"Prediction: {prediction}")
|
49 |
return "High likelihood of heart failure" if prediction == 1 else "Low likelihood of heart failure"
|
50 |
|
51 |
# Define Gradio inputs
|