Datasets:
Upload p53.py
Browse files
p53.py
CHANGED
|
@@ -70,7 +70,9 @@ class P53(datasets.GeneratorBasedBuilder):
|
|
| 70 |
|
| 71 |
def _generate_examples(self, filepath: str):
|
| 72 |
data = pandas.read_csv(filepath, header=None).head(200)
|
|
|
|
| 73 |
data = self.preprocess(data)
|
|
|
|
| 74 |
|
| 75 |
for row_id, row in data.iterrows():
|
| 76 |
data_row = dict(row)
|
|
@@ -82,7 +84,8 @@ class P53(datasets.GeneratorBasedBuilder):
|
|
| 82 |
encoding_function = partial(self.encode, feature)
|
| 83 |
data.loc[:, feature] = data[feature].apply(encoding_function)
|
| 84 |
|
| 85 |
-
for feature in list(data.colums)[:-1]:
|
|
|
|
| 86 |
data[data[feature] == "?", feature] = data[feature].mean()
|
| 87 |
|
| 88 |
return data[list(features_types_per_config[self.config.name].keys())]
|
|
|
|
| 70 |
|
| 71 |
def _generate_examples(self, filepath: str):
|
| 72 |
data = pandas.read_csv(filepath, header=None).head(200)
|
| 73 |
+
print("preprocessing..")
|
| 74 |
data = self.preprocess(data)
|
| 75 |
+
print("preprocessed!\n\n\n\n")
|
| 76 |
|
| 77 |
for row_id, row in data.iterrows():
|
| 78 |
data_row = dict(row)
|
|
|
|
| 84 |
encoding_function = partial(self.encode, feature)
|
| 85 |
data.loc[:, feature] = data[feature].apply(encoding_function)
|
| 86 |
|
| 87 |
+
for i, feature in enumerate(list(data.colums)[:-1]):
|
| 88 |
+
print(f"on feature {i}")
|
| 89 |
data[data[feature] == "?", feature] = data[feature].mean()
|
| 90 |
|
| 91 |
return data[list(features_types_per_config[self.config.name].keys())]
|