Datasets:
Upload bank.py
Browse files
bank.py
CHANGED
@@ -130,14 +130,14 @@ class Bank(datasets.GeneratorBasedBuilder):
|
|
130 |
data.drop("duration", axis="columns", inplace=True)
|
131 |
data.drop("poutcome", axis="columns", inplace=True)
|
132 |
|
133 |
-
data.columns = _BASE_FEATURE_NAMES
|
134 |
-
|
135 |
# discretize features
|
136 |
data.loc[:, "education"] = data.education.apply(self.encode_education)
|
137 |
data.loc[:, "loan"] = data.loan.apply(self.encode_yes_no)
|
138 |
data.loc[:, "housing"] = data.housing.apply(self.encode_yes_no)
|
139 |
data.loc[:, "default"] = data.default.apply(self.encode_yes_no)
|
140 |
|
|
|
|
|
141 |
if config == "subscription":
|
142 |
return data
|
143 |
else:
|
|
|
130 |
data.drop("duration", axis="columns", inplace=True)
|
131 |
data.drop("poutcome", axis="columns", inplace=True)
|
132 |
|
|
|
|
|
133 |
# discretize features
|
134 |
data.loc[:, "education"] = data.education.apply(self.encode_education)
|
135 |
data.loc[:, "loan"] = data.loan.apply(self.encode_yes_no)
|
136 |
data.loc[:, "housing"] = data.housing.apply(self.encode_yes_no)
|
137 |
data.loc[:, "default"] = data.default.apply(self.encode_yes_no)
|
138 |
|
139 |
+
data.columns = _BASE_FEATURE_NAMES
|
140 |
+
|
141 |
if config == "subscription":
|
142 |
return data
|
143 |
else:
|