Datasets:
Upload german.py
Browse files
german.py
CHANGED
|
@@ -227,8 +227,11 @@ class German(datasets.GeneratorBasedBuilder):
|
|
| 227 |
if feature not in ["marital_status", "sex"]:
|
| 228 |
encoding_function = partial(self.encode, feature)
|
| 229 |
data.loc[:, feature] = data[feature].apply(encoding_function)
|
| 230 |
-
|
| 231 |
-
|
|
|
|
|
|
|
|
|
|
| 232 |
data.loc[:, "loan_purpose"] = data.loan_purpose.apply(self.encode_loan_purpose)
|
| 233 |
data.loc[:, "loan_granted"] = data.loan_granted.apply(lambda x: x - 1)
|
| 234 |
|
|
|
|
| 227 |
if feature not in ["marital_status", "sex"]:
|
| 228 |
encoding_function = partial(self.encode, feature)
|
| 229 |
data.loc[:, feature] = data[feature].apply(encoding_function)
|
| 230 |
+
|
| 231 |
+
encode_marital_status = partial(self.encode, "marital_status")
|
| 232 |
+
encode_sex = partial(self.encode, "sex")
|
| 233 |
+
data.loc[:, "marital_status"] = data.personal_status_and_sex.apply(encode_marital_status)
|
| 234 |
+
data.loc[:, "sex"] = data.personal_status_and_sex.apply(encode_sex)
|
| 235 |
data.loc[:, "loan_purpose"] = data.loan_purpose.apply(self.encode_loan_purpose)
|
| 236 |
data.loc[:, "loan_granted"] = data.loan_granted.apply(lambda x: x - 1)
|
| 237 |
|