Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def predict(age, workclass, education, marital_status, occupation, relationship,
|
|
21 |
"race":[race], "gender":[gender], "capital-gain":[capital_gain], "capital-loss":[capital_loss],
|
22 |
"hours-per-week":[hours_per_week], "native-country":[native_country]}
|
23 |
df = pd.DataFrame(data=columns)
|
24 |
-
fixed_features = cleaning_features(df)
|
25 |
# with open('ann_model.pkl', 'rb') as ann_model_file:
|
26 |
# ann_model = pickle.load(ann_model_file)
|
27 |
scaler = StandardScaler()
|
@@ -31,7 +31,7 @@ def predict(age, workclass, education, marital_status, occupation, relationship,
|
|
31 |
# prediction = 1
|
32 |
return "Income >50K" if prediction == 1 else "Income <=50K"
|
33 |
|
34 |
-
def cleaning_features(data):
|
35 |
# with open('race_onehot_encoder.pkl', 'rb') as enc_file:
|
36 |
# encoder = pickle.load(enc_file)
|
37 |
|
|
|
21 |
"race":[race], "gender":[gender], "capital-gain":[capital_gain], "capital-loss":[capital_loss],
|
22 |
"hours-per-week":[hours_per_week], "native-country":[native_country]}
|
23 |
df = pd.DataFrame(data=columns)
|
24 |
+
fixed_features = cleaning_features(df,race)
|
25 |
# with open('ann_model.pkl', 'rb') as ann_model_file:
|
26 |
# ann_model = pickle.load(ann_model_file)
|
27 |
scaler = StandardScaler()
|
|
|
31 |
# prediction = 1
|
32 |
return "Income >50K" if prediction == 1 else "Income <=50K"
|
33 |
|
34 |
+
def cleaning_features(data,race):
|
35 |
# with open('race_onehot_encoder.pkl', 'rb') as enc_file:
|
36 |
# encoder = pickle.load(enc_file)
|
37 |
|