Spaces:
Sleeping
Sleeping
Sync App files
Browse files- drug_app.py +12 -5
drug_app.py
CHANGED
|
@@ -11,14 +11,20 @@ def classifier(Age, Sex, BP, Cholesterol, Na_to_K):
|
|
| 11 |
|
| 12 |
|
| 13 |
inputs = [
|
| 14 |
-
gr.Slider(15, 74, step=1, label="Age"
|
| 15 |
-
gr.Radio(["M", "F"], label="Sex"
|
| 16 |
-
gr.Radio(["HIGH", "LOW", "NORMAL"], label="Blood Pressure"
|
| 17 |
-
gr.Radio(["HIGH", "NORMAL"], label="Cholesterol"
|
| 18 |
-
gr.Slider(6.2, 38.2, step=0.1, label="Na_to_K"
|
| 19 |
]
|
| 20 |
outputs = [gr.Label(num_top_classes=5)]
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
title = "Drug Classification"
|
| 23 |
description = "Enter the details to correctly identify Drug type?"
|
| 24 |
|
|
@@ -26,6 +32,7 @@ gr.Interface(
|
|
| 26 |
fn=classifier,
|
| 27 |
inputs=inputs,
|
| 28 |
outputs=outputs,
|
|
|
|
| 29 |
title=title,
|
| 30 |
description=description,
|
| 31 |
).launch()
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
inputs = [
|
| 14 |
+
gr.Slider(15, 74, step=1, label="Age"),
|
| 15 |
+
gr.Radio(["M", "F"], label="Sex"),
|
| 16 |
+
gr.Radio(["HIGH", "LOW", "NORMAL"], label="Blood Pressure"),
|
| 17 |
+
gr.Radio(["HIGH", "NORMAL"], label="Cholesterol"),
|
| 18 |
+
gr.Slider(6.2, 38.2, step=0.1, label="Na_to_K"),
|
| 19 |
]
|
| 20 |
outputs = [gr.Label(num_top_classes=5)]
|
| 21 |
|
| 22 |
+
examples=[
|
| 23 |
+
[30, "M", "HIGH", "NORMAL", 15.4],
|
| 24 |
+
[35, "F", "LOW", "NORMAL", 8],
|
| 25 |
+
[50, "M", "HIGH", "HIGH", 34],
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
title = "Drug Classification"
|
| 29 |
description = "Enter the details to correctly identify Drug type?"
|
| 30 |
|
|
|
|
| 32 |
fn=classifier,
|
| 33 |
inputs=inputs,
|
| 34 |
outputs=outputs,
|
| 35 |
+
examples=examples,
|
| 36 |
title=title,
|
| 37 |
description=description,
|
| 38 |
).launch()
|