mstz commited on
Commit
d2fe9b6
·
1 Parent(s): 8c4b0a2

Upload adult.py

Browse files
Files changed (1) hide show
  1. adult.py +2 -2
adult.py CHANGED
@@ -236,11 +236,11 @@ class Adult(datasets.GeneratorBasedBuilder):
236
 
237
  def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
238
  data.drop("education", axis="columns", inplace=True)
239
- data = data.rename(columns={"threshold": "over_threshold"})
240
 
241
  data = data[["age", "capital_gain", "capital_loss", "education-num", "final_weight",
242
  "hours_per_week", "marital_status", "native_country", "occupation",
243
- "race", "relationship", "sex", "workclass", "over_threshold"]]
244
  data.columns = _BASE_FEATURE_NAMES
245
 
246
  for feature in _ENCODING_DICS:
 
236
 
237
  def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
238
  data.drop("education", axis="columns", inplace=True)
239
+ data = data.rename(columns={"threshold": "over_threshold", "sex": "is_male"})
240
 
241
  data = data[["age", "capital_gain", "capital_loss", "education-num", "final_weight",
242
  "hours_per_week", "marital_status", "native_country", "occupation",
243
+ "race", "relationship", "is_male", "workclass", "over_threshold"]]
244
  data.columns = _BASE_FEATURE_NAMES
245
 
246
  for feature in _ENCODING_DICS: