Nathanotal commited on
Commit
f1f699f
·
1 Parent(s): fecaffd
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -135,16 +135,15 @@ featureLabels = ["Pclass", "Name", "Sex", "Age", "SibSp",
135
 
136
  for feature in featureLabels:
137
  if feature in numericalInputs:
138
- print(feature)
139
- if feature.lower() == 'Age'.lower():
140
  inputs.append(gr.inputs.Slider(9, 75, 1, label='Age (years)'))
141
- if feature.lower() == 'SibSp'.lower():
142
  inputs.append(gr.inputs.Slider(
143
  0, 10, 1, label='Number of siblings/spouses aboard'))
144
- if feature.lower() == 'Parch'.lower():
145
  inputs.append(gr.inputs.Slider(
146
  0, 10, 1, label='Number of parents/children aboard'))
147
- if feature.lower() == 'Fare'.lower():
148
  inputs.append(gr.inputs.Slider(0, 1000, 1, label='Ticket fare'))
149
  else:
150
  raise Exception(f'Feature: "{feature}" not found')
@@ -152,13 +151,13 @@ for feature in featureLabels:
152
  pass
153
  # inputs.append(gr.Inputs.Textbox(default='text', label=feature))
154
  elif feature in categoricalInputs:
155
- if feature.lower() == "Sex".lower():
156
  inputs.append(gr.inputs.Dropdown(
157
  choices=catToInput.get(feature), default="male", label=feature))
158
- if feature.lower() == "Embarked".lower():
159
  inputs.append(gr.inputs.Dropdown(
160
  choices=catToInput.get(feature), default="Southampton", label='City of embarkation'))
161
- if feature.lower() == "Pclass".lower():
162
  inputs.append(gr.inputs.Dropdown(
163
  choices=catToInput.get(feature), default=3, label='Ticket class'))
164
  else:
 
135
 
136
  for feature in featureLabels:
137
  if feature in numericalInputs:
138
+ if feature == 'Age':
 
139
  inputs.append(gr.inputs.Slider(9, 75, 1, label='Age (years)'))
140
+ elif feature == 'SibSp':
141
  inputs.append(gr.inputs.Slider(
142
  0, 10, 1, label='Number of siblings/spouses aboard'))
143
+ elif feature == 'Parch':
144
  inputs.append(gr.inputs.Slider(
145
  0, 10, 1, label='Number of parents/children aboard'))
146
+ elif feature == 'Fare':
147
  inputs.append(gr.inputs.Slider(0, 1000, 1, label='Ticket fare'))
148
  else:
149
  raise Exception(f'Feature: "{feature}" not found')
 
151
  pass
152
  # inputs.append(gr.Inputs.Textbox(default='text', label=feature))
153
  elif feature in categoricalInputs:
154
+ if feature == "Sex":
155
  inputs.append(gr.inputs.Dropdown(
156
  choices=catToInput.get(feature), default="male", label=feature))
157
+ elif feature == "Embarked":
158
  inputs.append(gr.inputs.Dropdown(
159
  choices=catToInput.get(feature), default="Southampton", label='City of embarkation'))
160
+ elif feature == "Pclass":
161
  inputs.append(gr.inputs.Dropdown(
162
  choices=catToInput.get(feature), default=3, label='Ticket class'))
163
  else: