test
Browse files
test.py
CHANGED
|
@@ -63,7 +63,7 @@ class Test(datasets.GeneratorBasedBuilder):
|
|
| 63 |
|
| 64 |
def _split_generators(self, dl_manager):
|
| 65 |
data_dir = os.path.join(self.config.data_dir, self.config.name)
|
| 66 |
-
set_trace()
|
| 67 |
return [
|
| 68 |
datasets.SplitGenerator(
|
| 69 |
name=datasets.Split.TRAIN,
|
|
@@ -86,10 +86,11 @@ class Test(datasets.GeneratorBasedBuilder):
|
|
| 86 |
if self.config.name == "customers":
|
| 87 |
# Subset A expects three columns: feature_a1, feature_a2, label
|
| 88 |
_, feature_a1, feature_a2, label = line.strip().split(",")
|
|
|
|
| 89 |
yield id_, {
|
| 90 |
"customer_id": feature_a1,
|
| 91 |
"name": feature_a2,
|
| 92 |
-
"age": label,
|
| 93 |
}
|
| 94 |
elif self.config.name == "products":
|
| 95 |
# Subset B expects four columns: feature_b1, feature_b2, additional_info, label
|
|
@@ -97,5 +98,5 @@ class Test(datasets.GeneratorBasedBuilder):
|
|
| 97 |
yield id_, {
|
| 98 |
"product_id": feature_b1,
|
| 99 |
"name": feature_b2,
|
| 100 |
-
"price": additional_info,
|
| 101 |
}
|
|
|
|
| 63 |
|
| 64 |
def _split_generators(self, dl_manager):
|
| 65 |
data_dir = os.path.join(self.config.data_dir, self.config.name)
|
| 66 |
+
# set_trace()
|
| 67 |
return [
|
| 68 |
datasets.SplitGenerator(
|
| 69 |
name=datasets.Split.TRAIN,
|
|
|
|
| 86 |
if self.config.name == "customers":
|
| 87 |
# Subset A expects three columns: feature_a1, feature_a2, label
|
| 88 |
_, feature_a1, feature_a2, label = line.strip().split(",")
|
| 89 |
+
set_trace()
|
| 90 |
yield id_, {
|
| 91 |
"customer_id": feature_a1,
|
| 92 |
"name": feature_a2,
|
| 93 |
+
"age": int(label),
|
| 94 |
}
|
| 95 |
elif self.config.name == "products":
|
| 96 |
# Subset B expects four columns: feature_b1, feature_b2, additional_info, label
|
|
|
|
| 98 |
yield id_, {
|
| 99 |
"product_id": feature_b1,
|
| 100 |
"name": feature_b2,
|
| 101 |
+
"price": float(additional_info),
|
| 102 |
}
|