Parthebhan commited on
Commit
2642ace
·
verified ·
1 Parent(s): abbb9cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -15
app.py CHANGED
@@ -11,26 +11,26 @@ def salarybracket(age, workclass, education, education_num, marital_status, occu
11
  prediction = model.predict(inputs)
12
  prediction_value = prediction[0][0] # Assuming the prediction is a scalar
13
  result = "Income_bracket lesser than or equal to 50K" if prediction_value <= 0.5 else "Income_bracket greater than 50K"
14
- return f"Income_bracket Prediction: {prediction_value} \n\nResult: {result}"
15
 
16
 
17
  # Create the Gradio interface
18
  salarybracket_ga = gr.Interface(fn=salarybracket,
19
  inputs = [
20
- gr.Number(13.0, 84.0, label="Age: [13 to 84]"),
21
- gr.Number(1.0, 28.0, label="workclass: [1 to 28]"),
22
- gr.Number(10.0, 32.0, label="education: [10 to 32]"),
23
- gr.Number(0.0, 11.0, label="education_num: [0 to 11]"),
24
- gr.Number(0.0, 1.0, label="marital_status: [0 or 1]"),
25
- gr.Number(0.0, 37.0, label="occupation: [0 to 37]"),
26
- gr.Number(0.0, 37.0, label="relationship: [0 to 37]"),
27
- gr.Number(0.0, 1.0, label="race: [0 or 1]"),
28
- gr.Number(0.0, 30.0, label="gender: [0 to 30]"),
29
- gr.Number(0.0, 1.0, label="capital_gain: [0 or 1]"),
30
- gr.Number(0.0, 19.0, label="capital_loss: [0.0 19.0]"),
31
- gr.Number(0.0, 1.0, label="hours_per_week: [0 or 1]"),
32
- gr.Number(0.0, 1.0, label="native_country: [0 or 1]"),
33
- ],
34
  outputs="text", title="Salary Bracket Prediction",
35
  examples = [
36
  [75,0,0,6,6,0,2,1,0,0,0,1,3,0,0],
 
11
  prediction = model.predict(inputs)
12
  prediction_value = prediction[0][0] # Assuming the prediction is a scalar
13
  result = "Income_bracket lesser than or equal to 50K" if prediction_value <= 0.5 else "Income_bracket greater than 50K"
14
+ return f"Result: {result}"
15
 
16
 
17
  # Create the Gradio interface
18
  salarybracket_ga = gr.Interface(fn=salarybracket,
19
  inputs = [
20
+ gr.Number(17, 90, label="Age [17 to 90]"),
21
+ gr.Number(0, 8, label="Workclass [0 to 8]"),
22
+ gr.Number(0, 15, label="Education [0 to 15]"),
23
+ gr.Number(1, 16, label="Education Num [1 to 16]"),
24
+ gr.Number(0, 6, label="Marital Status [0 to 6]"),
25
+ gr.Number(0, 14, label="Occupation [0 to 14]"),
26
+ gr.Number(0, 5, label="Relationship [0 to 5]"),
27
+ gr.Number(0, 4, label="Race [0 to 4]"),
28
+ gr.Number(0, 1, label="Gender [0 to 1]"),
29
+ gr.Number(0, 99999, label="Capital Gain [0 to 99999]"),
30
+ gr.Number(0, 4356, label="Capital Loss [0 to 4356]"),
31
+ gr.Number(1, 99, label="Hours per Week [1 to 99]"),
32
+ gr.Number(0, 40, label="Native Country [0 to 40]"),
33
+ ]
34
  outputs="text", title="Salary Bracket Prediction",
35
  examples = [
36
  [75,0,0,6,6,0,2,1,0,0,0,1,3,0,0],