Datasets:
Upload german.py
Browse files
german.py
CHANGED
@@ -135,7 +135,7 @@ class Breast(datasets.GeneratorBasedBuilder):
|
|
135 |
]
|
136 |
|
137 |
def _generate_examples(self, filepath: str):
|
138 |
-
data = pandas.read_csv(filepath, header=None)
|
139 |
data.columns=_ORIGINAL_FEATURE_NAMES
|
140 |
data = self.preprocess(data, config=self.config.name)
|
141 |
|
@@ -158,6 +158,7 @@ class Breast(datasets.GeneratorBasedBuilder):
|
|
158 |
data.loc[:, "loan_granted"] = data.loan_granted.apply(self.encode_loan_granted)
|
159 |
data.loc[:, "marital_status"] = data.marital_status.apply(self.encode_marital_status)
|
160 |
data.loc[:, "sex"] = data.sex.apply(self.encode_sex)
|
|
|
161 |
|
162 |
data.drop("personal_status_and_sex", axis="columns", inplace=True)
|
163 |
|
|
|
135 |
]
|
136 |
|
137 |
def _generate_examples(self, filepath: str):
|
138 |
+
data = pandas.read_csv(filepath, sep=" ", header=None)
|
139 |
data.columns=_ORIGINAL_FEATURE_NAMES
|
140 |
data = self.preprocess(data, config=self.config.name)
|
141 |
|
|
|
158 |
data.loc[:, "loan_granted"] = data.loan_granted.apply(self.encode_loan_granted)
|
159 |
data.loc[:, "marital_status"] = data.marital_status.apply(self.encode_marital_status)
|
160 |
data.loc[:, "sex"] = data.sex.apply(self.encode_sex)
|
161 |
+
data.loc[:, "loan_granted"] = data.loan_granted.apply(lambda x: x - 1)
|
162 |
|
163 |
data.drop("personal_status_and_sex", axis="columns", inplace=True)
|
164 |
|