Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,6 @@ except:
|
|
51 |
|
52 |
# Streamlit app title and description
|
53 |
st.title("PAAD Survival Prediction Submission Portal")
|
54 |
-
st.write("Upload your predictions for survival time to receive a C-Index score.")
|
55 |
|
56 |
# Form to upload CSV file
|
57 |
with st.form("submission_form"):
|
@@ -67,6 +66,9 @@ if submit_button and uploaded_file:
|
|
67 |
if "patient_id" in predictions.columns and "predicted_scores" in predictions.columns:
|
68 |
# Merge with ground truth to calculate C-Index
|
69 |
merged = pd.merge(ground_truth, predictions, on="patient_id", how="inner")
|
|
|
|
|
|
|
70 |
c_index = concordance_index(event_times=merged["survival_time"],
|
71 |
predicted_scores=merged["predicted_scores"],
|
72 |
event_observed=merged["vital_status"],
|
@@ -103,4 +105,5 @@ if submit_button and uploaded_file:
|
|
103 |
|
104 |
# Display the leaderboard
|
105 |
st.subheader("Leaderboard")
|
106 |
-
st.write(leaderboard_df.sort_values(by="C-Index", ascending=False).reset_index(drop=True))
|
|
|
|
51 |
|
52 |
# Streamlit app title and description
|
53 |
st.title("PAAD Survival Prediction Submission Portal")
|
|
|
54 |
|
55 |
# Form to upload CSV file
|
56 |
with st.form("submission_form"):
|
|
|
66 |
if "patient_id" in predictions.columns and "predicted_scores" in predictions.columns:
|
67 |
# Merge with ground truth to calculate C-Index
|
68 |
merged = pd.merge(ground_truth, predictions, on="patient_id", how="inner")
|
69 |
+
if merged.empty:
|
70 |
+
st.error("No matching patient IDs found between the ground truth and your submission. Please check your patient IDs.")
|
71 |
+
|
72 |
c_index = concordance_index(event_times=merged["survival_time"],
|
73 |
predicted_scores=merged["predicted_scores"],
|
74 |
event_observed=merged["vital_status"],
|
|
|
105 |
|
106 |
# Display the leaderboard
|
107 |
st.subheader("Leaderboard")
|
108 |
+
# st.write(leaderboard_df.sort_values(by="C-Index", ascending=False).reset_index(drop=True))
|
109 |
+
st.dataframe(leaderboard_df.sort_values(by="C-Index", ascending=False).reset_index(drop=True), height=400)
|