cnasa commited on
Commit
032c046
·
1 Parent(s): 79f3655

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -4
app.py CHANGED
@@ -148,10 +148,7 @@ def user_input():
148
  def generate_user_input():
149
  Sex_txt_list = ["homme","femme"]
150
  Sex_txt = random.choice(Sex_txt_list)
151
- if Sex_txt=="homme":
152
- Sex = 0
153
- else:
154
- Sex = 1
155
  HighBP = random.randint(0,1)
156
  HighChol = random.randint(0,1)
157
  CholCheck = random.randint(0,1)
@@ -173,6 +170,38 @@ def generate_user_input():
173
  Age = random.randint(1,13)
174
  Education = random.randint(1,6)
175
  Income = random.randint(1,8)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
 
177
  user_data = {'HighBP':HighBP, 'HighChol':HighChol, 'CholCheck':CholCheck, 'BMI':BMI, 'Smoker':Smoker,
178
  'Stroke':Stroke, 'HeartDiseaseorAttack':HeartDiseaseorAttack, 'PhysActivity':PhysActivity, 'Fruits':Fruits, 'Veggies':Veggies,
 
148
  def generate_user_input():
149
  Sex_txt_list = ["homme","femme"]
150
  Sex_txt = random.choice(Sex_txt_list)
151
+
 
 
 
152
  HighBP = random.randint(0,1)
153
  HighChol = random.randint(0,1)
154
  CholCheck = random.randint(0,1)
 
170
  Age = random.randint(1,13)
171
  Education = random.randint(1,6)
172
  Income = random.randint(1,8)
173
+
174
+
175
+
176
+ Sex_txt = st.sidebar.selectbox('Sex',("homme","femme"),Sex_txt)
177
+
178
+ if Sex_txt=="homme":
179
+
180
+ Sex = 0
181
+ else:
182
+ Sex = 1
183
+
184
+ HighBP = int(st.sidebar.selectbox('HighBP',(0,1),HighBP ))
185
+ HighChol = int(st.sidebar.selectbox('HighChol',(0,1),HighChol ))
186
+ CholCheck = int(st.sidebar.selectbox('CholCheck',(0,1),CholCheck ))
187
+ Smoker = int(st.sidebar.selectbox('Smoker',(0,1),Smoker ))
188
+ Stroke = int(st.sidebar.selectbox('Stroke',(0,1),Stroke ))
189
+ HeartDiseaseorAttack = int(st.sidebar.selectbox('HeartDiseaseorAttack',(0,1),HeartDiseaseorAttack ))
190
+ PhysActivity = int(st.sidebar.selectbox('PhysActivity',(0,1),PhysActivity ))
191
+ Fruits = int(st.sidebar.selectbox('Fruits',(0,1),Fruits ))
192
+ Veggies = int(st.sidebar.selectbox('Veggies',(0,1),Veggies ))
193
+ HvyAlcoholConsump = int(st.sidebar.selectbox('HvyAlcoholConsump',(0,1),HvyAlcoholConsump ))
194
+ AnyHealthcare = int(st.sidebar.selectbox('AnyHealthcare',(0,1),AnyHealthcare ))
195
+ NoDocbcCost = int(st.sidebar.selectbox('NoDocbcCost',(0,1),NoDocbcCost ))
196
+ DiffWalk = int(st.sidebar.selectbox('DiffWalk',(0,1),DiffWalk ))
197
+
198
+ GenHlth = int(st.sidebar.slider('GenHlth',1,5,GenHlth,step=1 ))
199
+ MentHlth = int(st.sidebar.slider('MentHlth',0,30,value=MentHlth,step=1 ))
200
+ PhysHlth = int(st.sidebar.slider('PhysHlth',0,30,value=PhysHlth,step=1 ))
201
+ BMI = int(st.sidebar.slider('BMI',12,98,BMI ))
202
+ Age = int(st.sidebar.slider('Age',1,13,value=Age,step=1 ))
203
+ Education = int(st.sidebar.slider('Education',1,6,value=Education,step=1 ))
204
+ Income = int(st.sidebar.slider('Income',1,8,value=Income,step=1 ))
205
 
206
  user_data = {'HighBP':HighBP, 'HighChol':HighChol, 'CholCheck':CholCheck, 'BMI':BMI, 'Smoker':Smoker,
207
  'Stroke':Stroke, 'HeartDiseaseorAttack':HeartDiseaseorAttack, 'PhysActivity':PhysActivity, 'Fruits':Fruits, 'Veggies':Veggies,