Update app.py
Browse files
app.py
CHANGED
@@ -43,13 +43,12 @@ def main_func(HighBP, HighChol, CholCheck, BMI, Smoker, Stroke, HeartDiseaseorAt
|
|
43 |
|
44 |
# Create the UI
|
45 |
title = "**Diabetes Predictor & Interpreter** "
|
46 |
-
description1 = """This app takes
|
47 |
|
48 |
description2 = """
|
49 |
-
To use the app, pick the most applicable option for you
|
50 |
"""
|
51 |
|
52 |
-
|
53 |
with gr.Blocks(title=title) as demo:
|
54 |
gr.Markdown(f"## {title}")
|
55 |
gr.Markdown(description1)
|
@@ -75,18 +74,12 @@ with gr.Blocks(title=title) as demo:
|
|
75 |
PhysHlth = gr.Slider(label="How many days was your physical health not good in the past 30 days? This includes physical illness and injuries.", minimum=0, maximum=30, value=0, step=1)
|
76 |
DiffWalk = gr.Radio(["No", "Yes"], label = "Do you have serious difficulty walking or climbing stairs?", type = "index")
|
77 |
Sex = gr.Radio(["Male", "Female"], label = "Sex", type = "index")
|
78 |
-
|
79 |
Age = gr.Dropdown(["18-24","25-29","30-34","35-39","40-44","45-49","50-54","55-59","60-64","65-69","70-74","75-79","80 and older"],label="Age (in years)", type = "index")
|
80 |
Education = gr.Dropdown(["Never attended school or only kindergarten","Grades 1 through 8 (Elementary)","Grades 9 through 11 (Some high school)","Grade 12 or GED (High school graduate)","College 1 year to 3 years (Some college or technical school)","College 4 years or more (College graduated)"],label="Education Level", type = "index")
|
81 |
Income = gr.Dropdown(["Less than $10,000","Less than $16,250","Less than $22,500","Less than $28,750","Less than $35,000","Less than $48,500","Less than $61,500","$75,000 or more"],label="Income Level", type = "index")
|
82 |
|
83 |
submit_btn = gr.Button("Analyze")
|
84 |
|
85 |
-
#Age = age_d[gr.Dropdown([1,2,3,4,5,6,7,8,9,10,11,12,13],label="Age",type = "index")]
|
86 |
-
#Education = education_d[gr.Dropdown([1,2,3,4,5,6],label="Education Level",type = "index")]
|
87 |
-
#Income = income_d[gr.Dropdown([1,2,3,4,5,6,7,8],label="Income Level",type = "index")]
|
88 |
-
|
89 |
-
|
90 |
with gr.Column(visible=True) as output_col:
|
91 |
label = gr.Label(label = "Predicted Label")
|
92 |
local_plot = gr.Plot(label = 'Shap:')
|
|
|
43 |
|
44 |
# Create the UI
|
45 |
title = "**Diabetes Predictor & Interpreter** "
|
46 |
+
description1 = """This app takes information from participants and predicts their diabetes likelihood. Do not use for medical diagnosis."""
|
47 |
|
48 |
description2 = """
|
49 |
+
To use the app, pick the most applicable option for you by ticking on the circles, adjusting the values, and clicking on the boxes to show the options. After completion, click on Analyze. There are two examples below to see how it works.
|
50 |
"""
|
51 |
|
|
|
52 |
with gr.Blocks(title=title) as demo:
|
53 |
gr.Markdown(f"## {title}")
|
54 |
gr.Markdown(description1)
|
|
|
74 |
PhysHlth = gr.Slider(label="How many days was your physical health not good in the past 30 days? This includes physical illness and injuries.", minimum=0, maximum=30, value=0, step=1)
|
75 |
DiffWalk = gr.Radio(["No", "Yes"], label = "Do you have serious difficulty walking or climbing stairs?", type = "index")
|
76 |
Sex = gr.Radio(["Male", "Female"], label = "Sex", type = "index")
|
|
|
77 |
Age = gr.Dropdown(["18-24","25-29","30-34","35-39","40-44","45-49","50-54","55-59","60-64","65-69","70-74","75-79","80 and older"],label="Age (in years)", type = "index")
|
78 |
Education = gr.Dropdown(["Never attended school or only kindergarten","Grades 1 through 8 (Elementary)","Grades 9 through 11 (Some high school)","Grade 12 or GED (High school graduate)","College 1 year to 3 years (Some college or technical school)","College 4 years or more (College graduated)"],label="Education Level", type = "index")
|
79 |
Income = gr.Dropdown(["Less than $10,000","Less than $16,250","Less than $22,500","Less than $28,750","Less than $35,000","Less than $48,500","Less than $61,500","$75,000 or more"],label="Income Level", type = "index")
|
80 |
|
81 |
submit_btn = gr.Button("Analyze")
|
82 |
|
|
|
|
|
|
|
|
|
|
|
83 |
with gr.Column(visible=True) as output_col:
|
84 |
label = gr.Label(label = "Predicted Label")
|
85 |
local_plot = gr.Plot(label = 'Shap:')
|