Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -36,16 +36,16 @@ def main():
|
|
36 |
st.title("Adult Income")
|
37 |
|
38 |
with st.form("questionaire"):
|
39 |
-
age =
|
40 |
-
workclass =
|
41 |
-
education =
|
42 |
-
Marital_Status =
|
43 |
-
occupation =
|
44 |
-
relationship =
|
45 |
-
race =
|
46 |
-
sex =
|
47 |
-
hours_per_week =
|
48 |
-
native_country =
|
49 |
|
50 |
# clicked==True only when the button is clicked
|
51 |
clicked = st.form_submit_button("Predict income")
|
@@ -61,5 +61,7 @@ def main():
|
|
61 |
"hours.per.week": [hours_per_week],
|
62 |
"native.country": [native_country]}))
|
63 |
# Show prediction
|
64 |
-
|
65 |
-
|
|
|
|
|
|
36 |
st.title("Adult Income")
|
37 |
|
38 |
with st.form("questionaire"):
|
39 |
+
age = st.slider('Age', min_value = 10, max_value = 100)
|
40 |
+
workclass = st.selectbox('Workclass', unique_class)
|
41 |
+
education = st.selectbox('Education', unique_education)
|
42 |
+
Marital_Status = st.selectbox('Marital Status', unique_marital_status)
|
43 |
+
occupation = st.selectbox('Occupation', unique_occupation)
|
44 |
+
relationship = st.selectbox('Relationship', unique_relationship)
|
45 |
+
race = st.selectbox('Race', unique_race)
|
46 |
+
sex = st.selectbox('Sex', unique_sex)
|
47 |
+
hours_per_week = st.slider('Hours Per Week', min_value = 1, max_value = 100)
|
48 |
+
native_country = st.selectbox('Native Country', unique_country)
|
49 |
|
50 |
# clicked==True only when the button is clicked
|
51 |
clicked = st.form_submit_button("Predict income")
|
|
|
61 |
"hours.per.week": [hours_per_week],
|
62 |
"native.country": [native_country]}))
|
63 |
# Show prediction
|
64 |
+
result = '>50K' if result[0] == 1 else '<=50K'
|
65 |
+
st.success('Your predicted income is'+result)
|
66 |
+
if __name__ = '__main__':
|
67 |
+
main() # Run main()
|