matsammut commited on
Commit
d03b180
·
verified ·
1 Parent(s): 85775ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -8
app.py CHANGED
@@ -66,14 +66,6 @@ def cleaning_features(data):
66
 
67
  data[numeric_cols] = scaler.fit_transform(data[numeric_cols])
68
 
69
-
70
- # 3. One-hot encode race
71
- for N in columns_to_encode:
72
- race_encoded = encoder.fit_transform(data[[N]])
73
- race_encoded_cols = encoder.get_feature_names_out([N])
74
- race_encoded_df = pd.DataFrame(race_encoded, columns=race_encoded_cols, index=data.index)
75
- # Combine the encoded data with original dataframe
76
- data = pd.concat([data.drop(N, axis=1), race_encoded_df], axis=1)
77
  # Binarize native country
78
  data['native-country'] = data['native-country'].apply(lambda x: x == 'United-States')
79
  data['native-country'] = data['native-country'].astype(int)
 
66
 
67
  data[numeric_cols] = scaler.fit_transform(data[numeric_cols])
68
 
 
 
 
 
 
 
 
 
69
  # Binarize native country
70
  data['native-country'] = data['native-country'].apply(lambda x: x == 'United-States')
71
  data['native-country'] = data['native-country'].astype(int)