Datasets:
Update mushroom.py
Browse files- mushroom.py +3 -3
mushroom.py
CHANGED
|
@@ -301,7 +301,7 @@ class Mushroom(datasets.GeneratorBasedBuilder):
|
|
| 301 |
]
|
| 302 |
|
| 303 |
def _generate_examples(self, filepath: str):
|
| 304 |
-
data = pandas.read_csv(filepath)
|
| 305 |
data = self.preprocess(data, config=self.config.name)
|
| 306 |
|
| 307 |
for row_id, row in data.iterrows():
|
|
@@ -311,8 +311,8 @@ class Mushroom(datasets.GeneratorBasedBuilder):
|
|
| 311 |
|
| 312 |
|
| 313 |
def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
|
| 314 |
-
|
| 315 |
-
|
| 316 |
data = data[features_types_per_config[config].keys()]
|
| 317 |
|
| 318 |
for feature in _ENCODING_DICS:
|
|
|
|
| 301 |
]
|
| 302 |
|
| 303 |
def _generate_examples(self, filepath: str):
|
| 304 |
+
data = pandas.read_csv(filepath, header=None)
|
| 305 |
data = self.preprocess(data, config=self.config.name)
|
| 306 |
|
| 307 |
for row_id, row in data.iterrows():
|
|
|
|
| 311 |
|
| 312 |
|
| 313 |
def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
|
| 314 |
+
data.columns = _ORIGINAL_FEATURE_NAMES
|
| 315 |
+
data.drop("stalk_root", axis="columns", inplace=True)
|
| 316 |
data = data[features_types_per_config[config].keys()]
|
| 317 |
|
| 318 |
for feature in _ENCODING_DICS:
|