Convert dataset to Parquet
#3
by
iszhaoxin
- opened
- README.md +58 -1
- customers/{validation.parquet → test-00000-of-00001.parquet} +2 -2
- customers/test.csv +0 -16
- customers/{test.parquet → train-00000-of-00001.parquet} +2 -2
- customers/train.csv +0 -71
- customers/val.csv +0 -16
- products/test.parquet → customers/validation-00000-of-00001.parquet +2 -2
- dataset_infos.json +0 -80
- customers/train.parquet → products/test-00000-of-00001.parquet +2 -2
- products/test.csv +0 -13
- products/train-00000-of-00001.parquet +3 -0
- products/train.csv +0 -57
- products/train.parquet +0 -3
- products/val.csv +0 -13
- products/validation-00000-of-00001.parquet +3 -0
- products/validation.parquet +0 -3
- test.py +0 -88
README.md
CHANGED
@@ -17,8 +17,65 @@ task_categories:
|
|
17 |
- other
|
18 |
task_ids:
|
19 |
- other-other
|
20 |
-
paperswithcode_id: null
|
21 |
pretty_name: test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
---
|
23 |
|
24 |
# Dataset Card for test
|
|
|
17 |
- other
|
18 |
task_ids:
|
19 |
- other-other
|
|
|
20 |
pretty_name: test
|
21 |
+
dataset_info:
|
22 |
+
- config_name: customers
|
23 |
+
features:
|
24 |
+
- name: customer_id
|
25 |
+
dtype: int32
|
26 |
+
- name: name
|
27 |
+
dtype: string
|
28 |
+
- name: age
|
29 |
+
dtype: int32
|
30 |
+
splits:
|
31 |
+
- name: train
|
32 |
+
num_bytes: 1604
|
33 |
+
num_examples: 70
|
34 |
+
- name: validation
|
35 |
+
num_bytes: 345
|
36 |
+
num_examples: 15
|
37 |
+
- name: test
|
38 |
+
num_bytes: 343
|
39 |
+
num_examples: 15
|
40 |
+
download_size: 5771
|
41 |
+
dataset_size: 2292
|
42 |
+
- config_name: products
|
43 |
+
features:
|
44 |
+
- name: product_id
|
45 |
+
dtype: int32
|
46 |
+
- name: name
|
47 |
+
dtype: string
|
48 |
+
- name: price
|
49 |
+
dtype: float32
|
50 |
+
splits:
|
51 |
+
- name: train
|
52 |
+
num_bytes: 1226
|
53 |
+
num_examples: 56
|
54 |
+
- name: validation
|
55 |
+
num_bytes: 263
|
56 |
+
num_examples: 12
|
57 |
+
- name: test
|
58 |
+
num_bytes: 262
|
59 |
+
num_examples: 12
|
60 |
+
download_size: 5619
|
61 |
+
dataset_size: 1751
|
62 |
+
configs:
|
63 |
+
- config_name: customers
|
64 |
+
data_files:
|
65 |
+
- split: train
|
66 |
+
path: customers/train-*
|
67 |
+
- split: validation
|
68 |
+
path: customers/validation-*
|
69 |
+
- split: test
|
70 |
+
path: customers/test-*
|
71 |
+
- config_name: products
|
72 |
+
data_files:
|
73 |
+
- split: train
|
74 |
+
path: products/train-*
|
75 |
+
- split: validation
|
76 |
+
path: products/validation-*
|
77 |
+
- split: test
|
78 |
+
path: products/test-*
|
79 |
---
|
80 |
|
81 |
# Dataset Card for test
|
customers/{validation.parquet → test-00000-of-00001.parquet}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9f7e5b6ddef226a3d843c0d2292b5c44a9c2a86795fc8ba6b261c2592e8538ae
|
3 |
+
size 1661
|
customers/test.csv
DELETED
@@ -1,16 +0,0 @@
|
|
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/{test.parquet → train-00000-of-00001.parquet}
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ed9f45164d6dda3a9a056559bcd6e189a2dd500ab76cdb524ea2c05213c81a7d
|
3 |
+
size 2447
|
customers/train.csv
DELETED
@@ -1,71 +0,0 @@
|
|
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
DELETED
@@ -1,16 +0,0 @@
|
|
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.parquet → customers/validation-00000-of-00001.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4527c1dfb6da1f46cb5dd04d30cf3f7531a7405c9de02f606afefb5140459489
|
3 |
+
size 1663
|
dataset_infos.json
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"customers": {
|
3 |
-
"description": "This is the customer dataset. It contains information about customer interactions.",
|
4 |
-
"citation": "@inproceedings{author2024dataset,\n title={A Dataset for Customer Interactions},\n author={Author, A.},\n booktitle={Conference on Data},\n year={2024}\n}",
|
5 |
-
"homepage": "https://example.com/customers",
|
6 |
-
"license": "MIT License",
|
7 |
-
"features": {
|
8 |
-
"customer_id": {
|
9 |
-
"dtype": "int32"
|
10 |
-
},
|
11 |
-
"purchase_amount": {
|
12 |
-
"dtype": "float32"
|
13 |
-
},
|
14 |
-
"age": {
|
15 |
-
"dtype": "int32"
|
16 |
-
}
|
17 |
-
},
|
18 |
-
"splits": {
|
19 |
-
"train": {
|
20 |
-
"num_examples": 70
|
21 |
-
},
|
22 |
-
"validation": {
|
23 |
-
"num_examples": 15
|
24 |
-
},
|
25 |
-
"test": {
|
26 |
-
"num_examples": 15
|
27 |
-
}
|
28 |
-
},
|
29 |
-
"download_size": 12345678,
|
30 |
-
"dataset_size": 23456789,
|
31 |
-
"task_categories": [
|
32 |
-
"tabular"
|
33 |
-
],
|
34 |
-
"task_ids": [
|
35 |
-
"regression"
|
36 |
-
],
|
37 |
-
"version": "1.0.0"
|
38 |
-
},
|
39 |
-
"products": {
|
40 |
-
"description": "This is the product dataset. It includes details about various products.",
|
41 |
-
"citation": "@inproceedings{author2024dataset,\n title={A Dataset for Product Analysis},\n author={Author, B.},\n booktitle={Product Analytics Conference},\n year={2024}\n}",
|
42 |
-
"homepage": "https://example.com/products",
|
43 |
-
"license": "Apache License 2.0",
|
44 |
-
"features": {
|
45 |
-
"product_id": {
|
46 |
-
"dtype": "int32"
|
47 |
-
},
|
48 |
-
"product_name": {
|
49 |
-
"dtype": "string"
|
50 |
-
},
|
51 |
-
"price": {
|
52 |
-
"dtype": "float32"
|
53 |
-
},
|
54 |
-
"in_stock": {
|
55 |
-
"dtype": "bool"
|
56 |
-
}
|
57 |
-
},
|
58 |
-
"splits": {
|
59 |
-
"train": {
|
60 |
-
"num_examples": 56
|
61 |
-
},
|
62 |
-
"validation": {
|
63 |
-
"num_examples": 12
|
64 |
-
},
|
65 |
-
"test": {
|
66 |
-
"num_examples": 12
|
67 |
-
}
|
68 |
-
},
|
69 |
-
"download_size": 7890123,
|
70 |
-
"dataset_size": 8901234,
|
71 |
-
"task_categories": [
|
72 |
-
"classification"
|
73 |
-
],
|
74 |
-
"task_ids": [
|
75 |
-
"binary_classification"
|
76 |
-
],
|
77 |
-
"version": "1.0.0"
|
78 |
-
}
|
79 |
-
}
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
customers/train.parquet → products/test-00000-of-00001.parquet
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:43e77ddd02b52925981bf735adab9c7aa5ed464cab70b391f8410a5ea5822851
|
3 |
+
size 1648
|
products/test.csv
DELETED
@@ -1,13 +0,0 @@
|
|
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-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:8450ecc2b1ac76ebf2568986d70fe2093f03448491535b037fff5361184c324d
|
3 |
+
size 2320
|
products/train.csv
DELETED
@@ -1,57 +0,0 @@
|
|
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/train.parquet
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:8c5f4beb9ffb06b884d7643537bbe2e4a0ee53a90e76a8f990195d7209fc092b
|
3 |
-
size 3581
|
|
|
|
|
|
|
|
products/val.csv
DELETED
@@ -1,13 +0,0 @@
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
products/validation-00000-of-00001.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0203017853134ebd6c91957eeea281b82708ec7b2cd419142842af427b245c04
|
3 |
+
size 1651
|
products/validation.parquet
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:3165f389d6d30a3c40fabf6e1719a6d6685c9a642006d9150922d73ad148090e
|
3 |
-
size 2739
|
|
|
|
|
|
|
|
test.py
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
from pdb import set_trace
|
3 |
-
|
4 |
-
import datasets
|
5 |
-
import pandas as pd
|
6 |
-
|
7 |
-
_CITATION = """\
|
8 |
-
Put your dataset citation here.
|
9 |
-
"""
|
10 |
-
|
11 |
-
_DESCRIPTION = """\
|
12 |
-
Description of your dataset goes here.
|
13 |
-
"""
|
14 |
-
|
15 |
-
_HOMEPAGE = "https://your-dataset-homepage.com"
|
16 |
-
|
17 |
-
_LICENSE = "License information goes here."
|
18 |
-
|
19 |
-
|
20 |
-
class Test(datasets.GeneratorBasedBuilder):
|
21 |
-
"""Your dataset description"""
|
22 |
-
|
23 |
-
BUILDER_CONFIGS = [
|
24 |
-
datasets.BuilderConfig(
|
25 |
-
name="customers",
|
26 |
-
data_dir="./",
|
27 |
-
version=datasets.Version("1.0.0"),
|
28 |
-
description="This is subset A"),
|
29 |
-
datasets.BuilderConfig(
|
30 |
-
name="products",
|
31 |
-
data_dir="./",
|
32 |
-
version=datasets.Version("1.0.0"),
|
33 |
-
description="This is subset B"),
|
34 |
-
]
|
35 |
-
|
36 |
-
def _info(self):
|
37 |
-
if self.config.name == "customers":
|
38 |
-
features = datasets.Features(
|
39 |
-
{
|
40 |
-
"customer_id": datasets.Value("int32"),
|
41 |
-
"name": datasets.Value("string"),
|
42 |
-
"age": datasets.Value("int32"),
|
43 |
-
}
|
44 |
-
)
|
45 |
-
elif self.config.name == "products":
|
46 |
-
features = datasets.Features(
|
47 |
-
{
|
48 |
-
"product_id": datasets.Value("int32"),
|
49 |
-
"name": datasets.Value("string"),
|
50 |
-
"price": datasets.Value("float32"),
|
51 |
-
}
|
52 |
-
)
|
53 |
-
else:
|
54 |
-
raise ValueError(f"Unknown subset: {self.config.name}")
|
55 |
-
|
56 |
-
return datasets.DatasetInfo(
|
57 |
-
description=_DESCRIPTION,
|
58 |
-
features=features,
|
59 |
-
supervised_keys=None,
|
60 |
-
homepage=_HOMEPAGE,
|
61 |
-
license=_LICENSE,
|
62 |
-
citation=_CITATION,
|
63 |
-
)
|
64 |
-
|
65 |
-
def _split_generators(self, dl_manager):
|
66 |
-
data_dir = os.path.join(self.config.data_dir, self.config.name)
|
67 |
-
# set_trace()
|
68 |
-
return [
|
69 |
-
datasets.SplitGenerator(
|
70 |
-
name=datasets.Split.TRAIN,
|
71 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "train.csv")},
|
72 |
-
),
|
73 |
-
datasets.SplitGenerator(
|
74 |
-
name=datasets.Split.VALIDATION,
|
75 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "val.csv")},
|
76 |
-
),
|
77 |
-
datasets.SplitGenerator(
|
78 |
-
name=datasets.Split.TEST,
|
79 |
-
gen_kwargs={"filepath": os.path.join(data_dir, "test.csv")},
|
80 |
-
),
|
81 |
-
]
|
82 |
-
|
83 |
-
def _generate_examples(self, filepath):
|
84 |
-
with open(filepath, encoding="utf-8") as f:
|
85 |
-
df = pd.read_csv(filepath, index_col=0)
|
86 |
-
for id_, item in df.iterrows():
|
87 |
-
# set_trace()
|
88 |
-
yield id_, item.to_dict()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|