Spaces:
Build error
Build error
Commit
·
9451a94
1
Parent(s):
d0b3409
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,14 @@ if st.button("Submit"):
|
|
| 26 |
# Get prediction
|
| 27 |
prediction = clf.predict(X)[0]
|
| 28 |
|
| 29 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
|
|
|
|
| 26 |
# Get prediction
|
| 27 |
prediction = clf.predict(X)[0]
|
| 28 |
|
| 29 |
+
st.write("Predicted Disease: " + prediction)
|
| 30 |
+
|
| 31 |
+
# You can also display the top N predicted classes with their probabilities
|
| 32 |
+
top_n = 5 # Change this value to display more or fewer top classes
|
| 33 |
+
top_n_classes = np.argsort(-confidence_scores)[:top_n]
|
| 34 |
+
st.text("Top {} Predicted Diseases:".format(top_n))
|
| 35 |
+
for i, class_idx in enumerate(top_n_classes):
|
| 36 |
+
st.text(f"{clf.classes_[class_idx]}: {confidence_scores[class_idx]:.2f}")
|
| 37 |
|
| 38 |
|
| 39 |
|