Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -180,47 +180,143 @@ def hbdscan_tranform(df_transformed):
|
|
| 180 |
|
| 181 |
# Shared inputs
|
| 182 |
ann_inputs = [
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 196 |
rf_inputs = [
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
hbd_inputs = [
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
|
| 225 |
# Interfaces for each model
|
| 226 |
ann_interface = gr.Interface(
|
|
|
|
| 180 |
|
| 181 |
# Shared inputs
|
| 182 |
ann_inputs = [
|
| 183 |
+
gr.Slider(18, 90, step=1, label="Age"),
|
| 184 |
+
gr.Dropdown(
|
| 185 |
+
["Private", "Self-emp-not-inc", "Self-emp-inc", "Federal-gov",
|
| 186 |
+
"Local-gov", "State-gov", "Without-pay", "Never-worked"],
|
| 187 |
+
label="Workclass"
|
| 188 |
+
),
|
| 189 |
+
gr.Dropdown(
|
| 190 |
+
["Bachelors", "Some-college", "11th", "HS-grad", "Prof-school",
|
| 191 |
+
"Assoc-acdm", "Assoc-voc", "9th", "7th-8th", "12th", "Masters",
|
| 192 |
+
"1st-4th", "10th", "Doctorate", "5th-6th", "Preschool"],
|
| 193 |
+
label="Education"
|
| 194 |
+
),
|
| 195 |
+
gr.Dropdown(
|
| 196 |
+
["Married-civ-spouse", "Divorced", "Never-married", "Separated",
|
| 197 |
+
"Widowed", "Married-spouse-absent", "Married-AF-spouse"],
|
| 198 |
+
label="Marital Status"
|
| 199 |
+
),
|
| 200 |
+
gr.Dropdown(
|
| 201 |
+
["Tech-support", "Craft-repair", "Other-service", "Sales",
|
| 202 |
+
"Exec-managerial", "Prof-specialty", "Handlers-cleaners",
|
| 203 |
+
"Machine-op-inspct", "Adm-clerical", "Farming-fishing",
|
| 204 |
+
"Transport-moving", "Priv-house-serv", "Protective-serv",
|
| 205 |
+
"Armed-Forces"],
|
| 206 |
+
label="Occupation"
|
| 207 |
+
),
|
| 208 |
+
gr.Dropdown(
|
| 209 |
+
["Wife", "Husband", "Own-child", "Unmarried", "Other-relative", "Not-in-family"],
|
| 210 |
+
label="Relationship"
|
| 211 |
+
),
|
| 212 |
+
gr.Dropdown(
|
| 213 |
+
["White", "Black", "Asian-Pac-Islander", "Amer-Indian-Eskimo", "Other"],
|
| 214 |
+
label="Race"
|
| 215 |
+
),
|
| 216 |
+
gr.Dropdown(
|
| 217 |
+
["Male", "Female"],
|
| 218 |
+
label="Gender"
|
| 219 |
+
),
|
| 220 |
+
gr.Slider(1, 60, step=1, label="Hours Per Week"),
|
| 221 |
+
gr.Slider(0, 100000, step=100, label="Capital Gain"),
|
| 222 |
+
gr.Slider(0, 5000, step=50, label="Capital Loss"),
|
| 223 |
+
gr.Dropdown(
|
| 224 |
+
["United-States", "Other"],
|
| 225 |
+
label="Native Country"
|
| 226 |
+
)
|
| 227 |
+
]
|
| 228 |
rf_inputs = [
|
| 229 |
+
gr.Slider(18, 90, step=1, label="Age"),
|
| 230 |
+
gr.Dropdown(
|
| 231 |
+
["Private", "Self-emp-not-inc", "Self-emp-inc", "Federal-gov",
|
| 232 |
+
"Local-gov", "State-gov", "Without-pay", "Never-worked"],
|
| 233 |
+
label="Workclass"
|
| 234 |
+
),
|
| 235 |
+
gr.Dropdown(
|
| 236 |
+
["Bachelors", "Some-college", "11th", "HS-grad", "Prof-school",
|
| 237 |
+
"Assoc-acdm", "Assoc-voc", "9th", "7th-8th", "12th", "Masters",
|
| 238 |
+
"1st-4th", "10th", "Doctorate", "5th-6th", "Preschool"],
|
| 239 |
+
label="Education"
|
| 240 |
+
),
|
| 241 |
+
gr.Dropdown(
|
| 242 |
+
["Married-civ-spouse", "Divorced", "Never-married", "Separated",
|
| 243 |
+
"Widowed", "Married-spouse-absent", "Married-AF-spouse"],
|
| 244 |
+
label="Marital Status"
|
| 245 |
+
),
|
| 246 |
+
gr.Dropdown(
|
| 247 |
+
["Tech-support", "Craft-repair", "Other-service", "Sales",
|
| 248 |
+
"Exec-managerial", "Prof-specialty", "Handlers-cleaners",
|
| 249 |
+
"Machine-op-inspct", "Adm-clerical", "Farming-fishing",
|
| 250 |
+
"Transport-moving", "Priv-house-serv", "Protective-serv",
|
| 251 |
+
"Armed-Forces"],
|
| 252 |
+
label="Occupation"
|
| 253 |
+
),
|
| 254 |
+
gr.Dropdown(
|
| 255 |
+
["Wife", "Husband", "Own-child", "Unmarried", "Other-relative", "Not-in-family"],
|
| 256 |
+
label="Relationship"
|
| 257 |
+
),
|
| 258 |
+
gr.Dropdown(
|
| 259 |
+
["White", "Black", "Asian-Pac-Islander", "Amer-Indian-Eskimo", "Other"],
|
| 260 |
+
label="Race"
|
| 261 |
+
),
|
| 262 |
+
gr.Dropdown(
|
| 263 |
+
["Male", "Female"],
|
| 264 |
+
label="Gender"
|
| 265 |
+
),
|
| 266 |
+
gr.Slider(1, 60, step=1, label="Hours Per Week"),
|
| 267 |
+
gr.Slider(0, 100000, step=100, label="Capital Gain"),
|
| 268 |
+
gr.Slider(0, 5000, step=50, label="Capital Loss"),
|
| 269 |
+
gr.Dropdown(
|
| 270 |
+
["United-States", "Other"],
|
| 271 |
+
label="Native Country"
|
| 272 |
+
)
|
| 273 |
+
]
|
| 274 |
hbd_inputs = [
|
| 275 |
+
gr.Slider(18, 90, step=1, label="Age"),
|
| 276 |
+
gr.Dropdown(
|
| 277 |
+
["Private", "Self-emp-not-inc", "Self-emp-inc", "Federal-gov",
|
| 278 |
+
"Local-gov", "State-gov", "Without-pay", "Never-worked"],
|
| 279 |
+
label="Workclass"
|
| 280 |
+
),
|
| 281 |
+
gr.Dropdown(
|
| 282 |
+
["Bachelors", "Some-college", "11th", "HS-grad", "Prof-school",
|
| 283 |
+
"Assoc-acdm", "Assoc-voc", "9th", "7th-8th", "12th", "Masters",
|
| 284 |
+
"1st-4th", "10th", "Doctorate", "5th-6th", "Preschool"],
|
| 285 |
+
label="Education"
|
| 286 |
+
),
|
| 287 |
+
gr.Dropdown(
|
| 288 |
+
["Married-civ-spouse", "Divorced", "Never-married", "Separated",
|
| 289 |
+
"Widowed", "Married-spouse-absent", "Married-AF-spouse"],
|
| 290 |
+
label="Marital Status"
|
| 291 |
+
),
|
| 292 |
+
gr.Dropdown(
|
| 293 |
+
["Tech-support", "Craft-repair", "Other-service", "Sales",
|
| 294 |
+
"Exec-managerial", "Prof-specialty", "Handlers-cleaners",
|
| 295 |
+
"Machine-op-inspct", "Adm-clerical", "Farming-fishing",
|
| 296 |
+
"Transport-moving", "Priv-house-serv", "Protective-serv",
|
| 297 |
+
"Armed-Forces"],
|
| 298 |
+
label="Occupation"
|
| 299 |
+
),
|
| 300 |
+
gr.Dropdown(
|
| 301 |
+
["Wife", "Husband", "Own-child", "Unmarried", "Other-relative", "Not-in-family"],
|
| 302 |
+
label="Relationship"
|
| 303 |
+
),
|
| 304 |
+
gr.Dropdown(
|
| 305 |
+
["White", "Black", "Asian-Pac-Islander", "Amer-Indian-Eskimo", "Other"],
|
| 306 |
+
label="Race"
|
| 307 |
+
),
|
| 308 |
+
gr.Dropdown(
|
| 309 |
+
["Male", "Female"],
|
| 310 |
+
label="Gender"
|
| 311 |
+
),
|
| 312 |
+
gr.Slider(1, 60, step=1, label="Hours Per Week"),
|
| 313 |
+
gr.Slider(0, 100000, step=100, label="Capital Gain"),
|
| 314 |
+
gr.Slider(0, 5000, step=50, label="Capital Loss"),
|
| 315 |
+
gr.Dropdown(
|
| 316 |
+
["United-States", "Other"],
|
| 317 |
+
label="Native Country"
|
| 318 |
+
)
|
| 319 |
+
]
|
| 320 |
|
| 321 |
# Interfaces for each model
|
| 322 |
ann_interface = gr.Interface(
|