Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -80,10 +80,10 @@ model.fit(train_ds)
|
|
80 |
def process_inputs(education, sex, capital_gains, capital_losses):
|
81 |
df = pd.DataFrame.from_dict(
|
82 |
{
|
83 |
-
"education": [
|
84 |
-
"sex": [
|
85 |
-
"capital_gains": [
|
86 |
-
"capital_losses": [
|
87 |
}
|
88 |
)
|
89 |
df = encode_df(df)
|
@@ -98,12 +98,10 @@ def process_inputs(education, sex, capital_gains, capital_losses):
|
|
98 |
pred = model.predict(df)
|
99 |
if pred > .5:
|
100 |
pred_bi = 1
|
101 |
-
return {"> $50,000"}
|
102 |
elif pred <=.5:
|
103 |
pred_bi = 0
|
104 |
-
return {"<= $50,000"}
|
105 |
-
|
106 |
-
|
107 |
|
108 |
iface = gr.Interface(
|
109 |
process_inputs,
|
|
|
80 |
def process_inputs(education, sex, capital_gains, capital_losses):
|
81 |
df = pd.DataFrame.from_dict(
|
82 |
{
|
83 |
+
"education": [education],
|
84 |
+
"sex": [sex],
|
85 |
+
"capital_gains": [capital_gains],
|
86 |
+
"capital_losses": [capital_losses]
|
87 |
}
|
88 |
)
|
89 |
df = encode_df(df)
|
|
|
98 |
pred = model.predict(df)
|
99 |
if pred > .5:
|
100 |
pred_bi = 1
|
101 |
+
return {"> $50,000": pred_bi}
|
102 |
elif pred <=.5:
|
103 |
pred_bi = 0
|
104 |
+
return {"<= $50,000": pred_bi}
|
|
|
|
|
105 |
|
106 |
iface = gr.Interface(
|
107 |
process_inputs,
|