matsammut commited on
Commit
197ffb2
·
verified ·
1 Parent(s): 4dbe0a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -3
app.py CHANGED
@@ -16,13 +16,52 @@ interface = gr.Interface(
16
  fn=predict,
17
  inputs=[
18
  gr.Slider(18, 90, step=1, label="Age"),
19
- gr.Slider(1, 99, step=1, label="Hours Per Week"),
20
- gr.Slider(1, 20, step=1, label="Education Level (Years)"),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  gr.Slider(0, 100000, step=100, label="Capital Gain"),
22
  gr.Slider(0, 5000, step=50, label="Capital Loss"),
 
 
 
 
23
  ],
24
  outputs="text",
25
- title="Adult Income Predictor",
26
  )
27
 
28
  # Launch the app
 
16
  fn=predict,
17
  inputs=[
18
  gr.Slider(18, 90, step=1, label="Age"),
19
+ gr.Dropdown(
20
+ ["Private", "Self-emp-not-inc", "Self-emp-inc", "Federal-gov",
21
+ "Local-gov", "State-gov", "Without-pay", "Never-worked"],
22
+ label="Workclass"
23
+ ),
24
+ gr.Dropdown(
25
+ ["Bachelors", "Some-college", "11th", "HS-grad", "Prof-school",
26
+ "Assoc-acdm", "Assoc-voc", "9th", "7th-8th", "12th", "Masters",
27
+ "1st-4th", "10th", "Doctorate", "5th-6th", "Preschool"],
28
+ label="Education"
29
+ ),
30
+ gr.Dropdown(
31
+ ["Married-civ-spouse", "Divorced", "Never-married", "Separated",
32
+ "Widowed", "Married-spouse-absent", "Married-AF-spouse"],
33
+ label="Marital Status"
34
+ ),
35
+ gr.Dropdown(
36
+ ["Tech-support", "Craft-repair", "Other-service", "Sales",
37
+ "Exec-managerial", "Prof-specialty", "Handlers-cleaners",
38
+ "Machine-op-inspct", "Adm-clerical", "Farming-fishing",
39
+ "Transport-moving", "Priv-house-serv", "Protective-serv",
40
+ "Armed-Forces"],
41
+ label="Occupation"
42
+ ),
43
+ gr.Dropdown(
44
+ ["Wife", "Husband", "Own-child", "Unmarried", "Other-relative", "Not-in-family"],
45
+ label="Relationship"
46
+ ),
47
+ gr.Dropdown(
48
+ ["White", "Black", "Asian-Pac-Islander", "Amer-Indian-Eskimo", "Other"],
49
+ label="Race"
50
+ ),
51
+ gr.Dropdown(
52
+ ["Male", "Female"],
53
+ label="Gender"
54
+ ),
55
+ gr.Slider(1, 90, step=1, label="Hours Per Week"),
56
  gr.Slider(0, 100000, step=100, label="Capital Gain"),
57
  gr.Slider(0, 5000, step=50, label="Capital Loss"),
58
+ gr.Dropdown(
59
+ ["United-States", "Other"],
60
+ label="Native Country"
61
+ )
62
  ],
63
  outputs="text",
64
+ title="Adult Income Predictor"
65
  )
66
 
67
  # Launch the app