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