Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ explainer = shap.Explainer(loaded_model) # PLEASE DO NOT CHANGE THIS.
|
|
| 14 |
|
| 15 |
# Create the main function for server
|
| 16 |
def main_func(age, education_num, sex, capital_gain, capital_loss, hours_per_week, salary_class):
|
| 17 |
-
|
| 18 |
new_row = pd.DataFrame.from_dict({'age':age,
|
| 19 |
'education-num':education_num,'sex':sex,'capital-gain':capital_gain,
|
| 20 |
'capital-loss':capital_loss, 'hours-per-week':hours_per_week,'salary-class':salary_class},
|
|
|
|
| 14 |
|
| 15 |
# Create the main function for server
|
| 16 |
def main_func(age, education_num, sex, capital_gain, capital_loss, hours_per_week, salary_class):
|
| 17 |
+
sex = 0 if sex == "Male" else 1
|
| 18 |
new_row = pd.DataFrame.from_dict({'age':age,
|
| 19 |
'education-num':education_num,'sex':sex,'capital-gain':capital_gain,
|
| 20 |
'capital-loss':capital_loss, 'hours-per-week':hours_per_week,'salary-class':salary_class},
|