Datasets:
Upload wine_origin.py
Browse files- wine_origin.py +2 -0
wine_origin.py
CHANGED
@@ -140,6 +140,8 @@ class WineOrigin(datasets.GeneratorBasedBuilder):
|
|
140 |
yield row_id, data_row
|
141 |
|
142 |
def preprocess(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
|
|
|
|
143 |
if self.config.name == "wine_origin_0":
|
144 |
data["class"] = data["class"].apply(lambda x: 1 if x == 0 else 0)
|
145 |
elif self.config.name == "wine_origin_1":
|
|
|
140 |
yield row_id, data_row
|
141 |
|
142 |
def preprocess(self, data: pandas.DataFrame) -> pandas.DataFrame:
|
143 |
+
data["class"] = data["class"].apply(lambda x: x - 1)
|
144 |
+
|
145 |
if self.config.name == "wine_origin_0":
|
146 |
data["class"] = data["class"].apply(lambda x: 1 if x == 0 else 0)
|
147 |
elif self.config.name == "wine_origin_1":
|