Datasets:
Upload german.py
Browse files
german.py
CHANGED
@@ -136,11 +136,11 @@ class Breast(datasets.GeneratorBasedBuilder):
|
|
136 |
|
137 |
def _generate_examples(self, filepath: str):
|
138 |
if self.config.name == "encoding":
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
|
145 |
for row_id, row in data.iterrows():
|
146 |
data_row = dict(row)
|
@@ -182,7 +182,6 @@ class Breast(datasets.GeneratorBasedBuilder):
|
|
182 |
full_data += d
|
183 |
data = pandas.DataFrame(full_data,
|
184 |
columns=["feature", "original_value", "encoded_value"])
|
185 |
-
print(data)
|
186 |
|
187 |
return data
|
188 |
|
|
|
136 |
|
137 |
def _generate_examples(self, filepath: str):
|
138 |
if self.config.name == "encoding":
|
139 |
+
data = self.encoding_dictionaries()
|
140 |
+
else:
|
141 |
+
data = pandas.read_csv(filepath, sep=" ", header=None)
|
142 |
+
data.columns=_ORIGINAL_FEATURE_NAMES
|
143 |
+
data = self.preprocess(data, config=self.config.name)
|
144 |
|
145 |
for row_id, row in data.iterrows():
|
146 |
data_row = dict(row)
|
|
|
182 |
full_data += d
|
183 |
data = pandas.DataFrame(full_data,
|
184 |
columns=["feature", "original_value", "encoded_value"])
|
|
|
185 |
|
186 |
return data
|
187 |
|