Spaces:
Sleeping
Sleeping
hackerbyhobby
commited on
updated app3
Browse files
app.py
CHANGED
@@ -49,21 +49,6 @@ def predict_heart_failure(age_category, alcohol_drinkers, chest_scan, covid_posi
|
|
49 |
return "High likelihood of heart failure" if prediction == 1 else "Low likelihood of heart failure"
|
50 |
|
51 |
|
52 |
-
def debug_model_input(input_df, model, threshold=0.5):
|
53 |
-
print("Input DataFrame passed to the model:")
|
54 |
-
print(input_df)
|
55 |
-
|
56 |
-
# Predict probabilities
|
57 |
-
probs = model.predict_proba(input_df)
|
58 |
-
print("Predicted probabilities:")
|
59 |
-
print(probs)
|
60 |
-
|
61 |
-
# Adjust threshold and make predictions
|
62 |
-
predictions = (probs[:, 1] >= threshold).astype(int)
|
63 |
-
print("Predictions with adjusted threshold:")
|
64 |
-
print(predictions)
|
65 |
-
|
66 |
-
debug_model_input(test_df, model, threshold=0.4)
|
67 |
|
68 |
# Define Gradio inputs
|
69 |
gradio_inputs = [
|
|
|
49 |
return "High likelihood of heart failure" if prediction == 1 else "Low likelihood of heart failure"
|
50 |
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
# Define Gradio inputs
|
54 |
gradio_inputs = [
|