Spaces:
Runtime error
Runtime error
Update app.py
#1
by
Chatop - opened
app.py
CHANGED
|
@@ -11,8 +11,6 @@ unique_sex = unique_values["sex"]
|
|
| 11 |
unique_smoker = unique_values["smoker"]
|
| 12 |
unique_region = unique_values["region"]
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
| 16 |
def main():
|
| 17 |
st.title("medical expenses")
|
| 18 |
|
|
@@ -20,7 +18,7 @@ def main():
|
|
| 20 |
age = st.slider("Age", min_value =10,max_value=100)
|
| 21 |
sex = st.selectbox("Sex", options=unique_sex)
|
| 22 |
bmi = st.slider("Bmi",min_value=10,max_value=100)
|
| 23 |
-
children = st.slider("Children", min_value=
|
| 24 |
smoker = st.selectbox("Smoker", options=unique_smoker)
|
| 25 |
region = st.selectbox("Region",options=unique_region)
|
| 26 |
|
|
@@ -34,7 +32,8 @@ def main():
|
|
| 34 |
"children": [children],
|
| 35 |
"smoker": [smoker],
|
| 36 |
"region": [region]}))
|
| 37 |
-
st.success("You predict medical expenses is
|
|
|
|
| 38 |
if __name__ == "__main__":
|
| 39 |
main()
|
| 40 |
|
|
|
|
| 11 |
unique_smoker = unique_values["smoker"]
|
| 12 |
unique_region = unique_values["region"]
|
| 13 |
|
|
|
|
|
|
|
| 14 |
def main():
|
| 15 |
st.title("medical expenses")
|
| 16 |
|
|
|
|
| 18 |
age = st.slider("Age", min_value =10,max_value=100)
|
| 19 |
sex = st.selectbox("Sex", options=unique_sex)
|
| 20 |
bmi = st.slider("Bmi",min_value=10,max_value=100)
|
| 21 |
+
children = st.slider("Children", min_value=0,max_value=10)
|
| 22 |
smoker = st.selectbox("Smoker", options=unique_smoker)
|
| 23 |
region = st.selectbox("Region",options=unique_region)
|
| 24 |
|
|
|
|
| 32 |
"children": [children],
|
| 33 |
"smoker": [smoker],
|
| 34 |
"region": [region]}))
|
| 35 |
+
st.success(f"You predict medical expenses is {result}")
|
| 36 |
+
|
| 37 |
if __name__ == "__main__":
|
| 38 |
main()
|
| 39 |
|