test
Browse files- .DS_Store +0 -0
- customers/test.csv +16 -0
- customers/train.csv +71 -0
- customers/val.csv +16 -0
- products/test.csv +13 -0
- products/train.csv +57 -0
- products/val.csv +13 -0
- test.py +90 -0
.DS_Store
ADDED
Binary file (6.15 kB). View file
|
|
customers/test.csv
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,customer_id,name,age
|
2 |
+
96,97,Customer_97,40
|
3 |
+
4,5,Customer_5,26
|
4 |
+
42,43,Customer_43,35
|
5 |
+
77,78,Customer_78,32
|
6 |
+
10,11,Customer_11,71
|
7 |
+
0,1,Customer_1,55
|
8 |
+
9,10,Customer_10,71
|
9 |
+
69,70,Customer_70,54
|
10 |
+
73,74,Customer_74,21
|
11 |
+
83,84,Customer_84,22
|
12 |
+
44,45,Customer_45,65
|
13 |
+
76,77,Customer_77,40
|
14 |
+
39,40,Customer_40,29
|
15 |
+
33,34,Customer_34,31
|
16 |
+
30,31,Customer_31,67
|
customers/train.csv
ADDED
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,customer_id,name,age
|
2 |
+
11,12,Customer_12,52
|
3 |
+
47,48,Customer_48,40
|
4 |
+
85,86,Customer_86,24
|
5 |
+
28,29,Customer_29,38
|
6 |
+
93,94,Customer_94,66
|
7 |
+
5,6,Customer_6,46
|
8 |
+
66,67,Customer_67,31
|
9 |
+
65,66,Customer_66,24
|
10 |
+
35,36,Customer_36,62
|
11 |
+
16,17,Customer_17,39
|
12 |
+
49,50,Customer_50,69
|
13 |
+
34,35,Customer_35,51
|
14 |
+
7,8,Customer_8,70
|
15 |
+
95,96,Customer_96,29
|
16 |
+
27,28,Customer_28,79
|
17 |
+
19,20,Customer_20,56
|
18 |
+
81,82,Customer_82,69
|
19 |
+
25,26,Customer_26,50
|
20 |
+
62,63,Customer_63,68
|
21 |
+
13,14,Customer_14,21
|
22 |
+
24,25,Customer_25,57
|
23 |
+
3,4,Customer_4,30
|
24 |
+
17,18,Customer_18,23
|
25 |
+
38,39,Customer_39,22
|
26 |
+
8,9,Customer_9,71
|
27 |
+
78,79,Customer_79,35
|
28 |
+
6,7,Customer_7,53
|
29 |
+
64,65,Customer_65,68
|
30 |
+
36,37,Customer_37,68
|
31 |
+
89,90,Customer_90,70
|
32 |
+
56,57,Customer_57,28
|
33 |
+
99,100,Customer_100,58
|
34 |
+
54,55,Customer_55,53
|
35 |
+
43,44,Customer_44,51
|
36 |
+
50,51,Customer_51,45
|
37 |
+
67,68,Customer_68,60
|
38 |
+
46,47,Customer_47,46
|
39 |
+
68,69,Customer_69,46
|
40 |
+
61,62,Customer_62,52
|
41 |
+
97,98,Customer_98,35
|
42 |
+
79,80,Customer_80,30
|
43 |
+
41,42,Customer_42,72
|
44 |
+
58,59,Customer_59,64
|
45 |
+
48,49,Customer_49,37
|
46 |
+
98,99,Customer_99,46
|
47 |
+
57,58,Customer_58,65
|
48 |
+
75,76,Customer_76,27
|
49 |
+
32,33,Customer_33,79
|
50 |
+
94,95,Customer_95,49
|
51 |
+
59,60,Customer_60,56
|
52 |
+
63,64,Customer_64,59
|
53 |
+
84,85,Customer_85,21
|
54 |
+
37,38,Customer_38,69
|
55 |
+
29,30,Customer_30,77
|
56 |
+
1,2,Customer_2,56
|
57 |
+
52,53,Customer_53,30
|
58 |
+
21,22,Customer_22,52
|
59 |
+
2,3,Customer_3,55
|
60 |
+
23,24,Customer_24,71
|
61 |
+
87,88,Customer_88,36
|
62 |
+
91,92,Customer_92,76
|
63 |
+
74,75,Customer_75,44
|
64 |
+
86,87,Customer_87,30
|
65 |
+
82,83,Customer_83,37
|
66 |
+
20,21,Customer_21,51
|
67 |
+
60,61,Customer_61,51
|
68 |
+
71,72,Customer_72,49
|
69 |
+
14,15,Customer_15,23
|
70 |
+
92,93,Customer_93,24
|
71 |
+
51,52,Customer_52,29
|
customers/val.csv
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,customer_id,name,age
|
2 |
+
26,27,Customer_27,58
|
3 |
+
53,54,Customer_54,43
|
4 |
+
70,71,Customer_71,22
|
5 |
+
15,16,Customer_16,49
|
6 |
+
45,46,Customer_46,57
|
7 |
+
88,89,Customer_89,73
|
8 |
+
40,41,Customer_41,79
|
9 |
+
12,13,Customer_13,69
|
10 |
+
72,73,Customer_73,79
|
11 |
+
55,56,Customer_56,43
|
12 |
+
80,81,Customer_81,27
|
13 |
+
18,19,Customer_19,58
|
14 |
+
90,91,Customer_91,23
|
15 |
+
31,32,Customer_32,33
|
16 |
+
22,23,Customer_23,53
|
products/test.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,product_id,name,price
|
2 |
+
4,5,Product_5,269.37079112122996
|
3 |
+
73,74,Product_74,685.4914088169825
|
4 |
+
30,31,Product_31,455.75885589146424
|
5 |
+
55,56,Product_56,417.2148362971622
|
6 |
+
33,34,Product_34,535.8877036986996
|
7 |
+
12,13,Product_13,850.2555800942548
|
8 |
+
35,36,Product_36,884.8205869267379
|
9 |
+
0,1,Product_1,781.976413555275
|
10 |
+
64,65,Product_65,343.7487279386133
|
11 |
+
28,29,Product_29,744.4778261439482
|
12 |
+
22,23,Product_23,245.88954088766758
|
13 |
+
67,68,Product_68,675.1697127782456
|
products/train.csv
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,product_id,name,price
|
2 |
+
34,35,Product_35,627.0339105804485
|
3 |
+
62,63,Product_63,795.2203625971675
|
4 |
+
42,43,Product_43,431.42174870634176
|
5 |
+
54,55,Product_55,171.29278952097133
|
6 |
+
16,17,Product_17,727.2072210972166
|
7 |
+
39,40,Product_40,488.4934137670739
|
8 |
+
56,57,Product_57,232.33327948040628
|
9 |
+
79,80,Product_80,818.5325554700922
|
10 |
+
7,8,Product_8,172.55514641687452
|
11 |
+
50,51,Product_51,484.58955660187667
|
12 |
+
53,54,Product_54,104.3223454128037
|
13 |
+
19,20,Product_20,627.8929825553761
|
14 |
+
66,67,Product_67,160.2453054361185
|
15 |
+
25,26,Product_26,733.2758690991045
|
16 |
+
44,45,Product_45,221.6231309201294
|
17 |
+
13,14,Product_14,646.7432023479928
|
18 |
+
76,77,Product_77,343.43198976410105
|
19 |
+
3,4,Product_4,472.5873287639955
|
20 |
+
17,18,Product_18,289.6892006326001
|
21 |
+
38,39,Product_39,935.7701837570473
|
22 |
+
8,9,Product_9,711.887311071343
|
23 |
+
65,66,Product_66,580.6405432081264
|
24 |
+
6,7,Product_7,267.3146277123249
|
25 |
+
36,37,Product_37,30.57509848504054
|
26 |
+
72,73,Product_73,893.1409905386581
|
27 |
+
58,59,Product_59,691.6589417200158
|
28 |
+
46,47,Product_47,136.55068856676792
|
29 |
+
78,79,Product_79,853.188338930974
|
30 |
+
15,16,Product_16,450.0831695158656
|
31 |
+
27,28,Product_28,881.2456312569794
|
32 |
+
41,42,Product_42,566.9732082525446
|
33 |
+
26,27,Product_27,742.0870715920396
|
34 |
+
48,49,Product_49,894.6951757165921
|
35 |
+
24,25,Product_25,794.4546339940993
|
36 |
+
43,44,Product_44,587.238548414977
|
37 |
+
77,78,Product_78,524.5048062872403
|
38 |
+
57,58,Product_58,590.7441471934189
|
39 |
+
11,12,Product_12,290.99334081899434
|
40 |
+
32,33,Product_33,10.535300745444836
|
41 |
+
75,76,Product_76,965.8899199420919
|
42 |
+
59,60,Product_60,821.4789406713716
|
43 |
+
63,64,Product_64,703.1451760515428
|
44 |
+
69,70,Product_70,878.63055771838
|
45 |
+
37,38,Product_38,475.778730622188
|
46 |
+
29,30,Product_30,911.5928884027744
|
47 |
+
1,2,Product_2,607.9732982452558
|
48 |
+
52,53,Product_53,669.7002011972322
|
49 |
+
21,22,Product_22,170.68073655716717
|
50 |
+
2,3,Product_3,521.0349099965142
|
51 |
+
23,24,Product_24,704.275434148361
|
52 |
+
74,75,Product_75,338.606477325675
|
53 |
+
20,21,Product_21,89.88173740252655
|
54 |
+
60,61,Product_61,666.7241424290982
|
55 |
+
71,72,Product_72,798.0284175208953
|
56 |
+
14,15,Product_15,646.53290939936
|
57 |
+
51,52,Product_52,319.54741973678875
|
products/val.csv
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
,product_id,name,price
|
2 |
+
45,46,Product_46,238.7534646641605
|
3 |
+
31,32,Product_32,272.12339271529373
|
4 |
+
18,19,Product_19,702.6422504593837
|
5 |
+
5,6,Product_6,286.3477557446952
|
6 |
+
61,62,Product_62,876.9379619780921
|
7 |
+
9,10,Product_10,507.5089689086898
|
8 |
+
47,48,Product_48,457.126492113172
|
9 |
+
70,71,Product_71,704.57755157279
|
10 |
+
49,50,Product_50,622.5561531442168
|
11 |
+
68,69,Product_69,809.4552429423823
|
12 |
+
40,41,Product_41,553.2586258624842
|
13 |
+
10,11,Product_11,347.22224358729665
|
test.py
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import datasets
|
3 |
+
|
4 |
+
_CITATION = """\
|
5 |
+
Put your dataset citation here.
|
6 |
+
"""
|
7 |
+
|
8 |
+
_DESCRIPTION = """\
|
9 |
+
Description of your dataset goes here.
|
10 |
+
"""
|
11 |
+
|
12 |
+
_HOMEPAGE = "https://your-dataset-homepage.com"
|
13 |
+
|
14 |
+
_LICENSE = "License information goes here."
|
15 |
+
|
16 |
+
|
17 |
+
class Test(datasets.GeneratorBasedBuilder):
|
18 |
+
"""Your dataset description"""
|
19 |
+
|
20 |
+
BUILDER_CONFIGS = [
|
21 |
+
datasets.BuilderConfig(name="customers", version=datasets.Version("1.0.0"), description="This is subset A"),
|
22 |
+
datasets.BuilderConfig(name="products", version=datasets.Version("1.0.0"), description="This is subset B"),
|
23 |
+
]
|
24 |
+
|
25 |
+
def _info(self):
|
26 |
+
if self.config.name == "customers":
|
27 |
+
features = datasets.Features(
|
28 |
+
{
|
29 |
+
"customer_id": datasets.Value("string"),
|
30 |
+
"name": datasets.Value("string"),
|
31 |
+
"age": datasets.Value("int32"),
|
32 |
+
}
|
33 |
+
)
|
34 |
+
elif self.config.name == "products":
|
35 |
+
features = datasets.Features(
|
36 |
+
{
|
37 |
+
"product_id": datasets.Value("float32"),
|
38 |
+
"name": datasets.Value("string"),
|
39 |
+
"price": datasets.Value("float32"),
|
40 |
+
}
|
41 |
+
)
|
42 |
+
else:
|
43 |
+
raise ValueError(f"Unknown subset: {self.config.name}")
|
44 |
+
|
45 |
+
return datasets.DatasetInfo(
|
46 |
+
description=_DESCRIPTION,
|
47 |
+
features=features,
|
48 |
+
supervised_keys=None,
|
49 |
+
homepage=_HOMEPAGE,
|
50 |
+
license=_LICENSE,
|
51 |
+
citation=_CITATION,
|
52 |
+
)
|
53 |
+
|
54 |
+
def _split_generators(self, dl_manager):
|
55 |
+
data_dir = os.path.join(self.config.data_dir, self.config.name)
|
56 |
+
return [
|
57 |
+
datasets.SplitGenerator(
|
58 |
+
name=datasets.Split.TRAIN,
|
59 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "train.csv")},
|
60 |
+
),
|
61 |
+
datasets.SplitGenerator(
|
62 |
+
name=datasets.Split.VALIDATION,
|
63 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "val.csv")},
|
64 |
+
),
|
65 |
+
datasets.SplitGenerator(
|
66 |
+
name=datasets.Split.TEST,
|
67 |
+
gen_kwargs={"filepath": os.path.join(data_dir, "test.csv")},
|
68 |
+
),
|
69 |
+
]
|
70 |
+
|
71 |
+
def _generate_examples(self, filepath):
|
72 |
+
with open(filepath, encoding="utf-8") as f:
|
73 |
+
for id_, line in enumerate(f):
|
74 |
+
# Example: Parsing CSV file based on the subset name
|
75 |
+
if self.config.name == "customers":
|
76 |
+
# Subset A expects three columns: feature_a1, feature_a2, label
|
77 |
+
feature_a1, feature_a2, label = line.strip().split(",")
|
78 |
+
yield id_, {
|
79 |
+
"customer_id": feature_a1,
|
80 |
+
"name": feature_a2,
|
81 |
+
"age": int(label),
|
82 |
+
}
|
83 |
+
elif self.config.name == "products":
|
84 |
+
# Subset B expects four columns: feature_b1, feature_b2, additional_info, label
|
85 |
+
feature_b1, feature_b2, additional_info = line.strip().split(",")
|
86 |
+
yield id_, {
|
87 |
+
"product_id": feature_b1,
|
88 |
+
"name": feature_b2,
|
89 |
+
"price": float(additional_info),
|
90 |
+
}
|