Convert dataset to Parquet

#8
by iszhaoxin - opened
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: int64
26
+ - name: name
27
+ dtype: string
28
+ - name: age
29
+ dtype: int64
30
+ splits:
31
+ - name: train
32
+ num_bytes: 2164
33
+ num_examples: 70
34
+ - name: validation
35
+ num_bytes: 465
36
+ num_examples: 15
37
+ - name: test
38
+ num_bytes: 463
39
+ num_examples: 15
40
+ download_size: 6030
41
+ dataset_size: 3092
42
+ - config_name: products
43
+ features:
44
+ - name: product_id
45
+ dtype: int64
46
+ - name: name
47
+ dtype: string
48
+ - name: price
49
+ dtype: float64
50
+ splits:
51
+ - name: train
52
+ num_bytes: 1674
53
+ num_examples: 56
54
+ - name: validation
55
+ num_bytes: 359
56
+ num_examples: 12
57
+ - name: test
58
+ num_bytes: 358
59
+ num_examples: 12
60
+ download_size: 6172
61
+ dataset_size: 2391
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/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5594c80522f04f61c7e8fd71ec9592b60c51deef2a29dc340d9208bd979a6c4e
3
+ size 1750
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/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:879e13f830fe6a77be919acd4942c0048fbd87c0a4e52f2c88166ffba66a50af
3
+ size 2530
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/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a051dec440d31820adb12a02d3170380378626d9b7343766c3e9ce76c23c7f98
3
+ size 1750
dataset_infos.json DELETED
@@ -1,61 +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": "int64",
10
- "_type": "Value"
11
- },
12
- "name": {
13
- "dtype": "string",
14
- "_type": "Value"
15
- },
16
- "age": {
17
- "dtype": "int64",
18
- "_type": "Value"
19
- }
20
- },
21
- "download_size": 12345678,
22
- "dataset_size": 23456789,
23
- "task_categories": [
24
- "tabular"
25
- ],
26
- "task_ids": [
27
- "regression"
28
- ],
29
- "version": "1.0.0"
30
- },
31
- "products": {
32
- "description": "This is the product dataset. It includes details about various products.",
33
- "citation": "@inproceedings{author2024dataset,\n title={A Dataset for Product Analysis},\n author={Author, B.},\n booktitle={Product Analytics Conference},\n year={2024}\n}",
34
- "homepage": "https://example.com/products",
35
- "license": "Apache License 2.0",
36
- "features": {
37
- "product_id": {
38
- "dtype": "int64",
39
- "_type": "Value"
40
- },
41
- "name": {
42
- "dtype": "string",
43
- "_type": "Value"
44
- },
45
- "price": {
46
- "dtype": "double",
47
- "_type": "Value"
48
- }
49
- },
50
- "download_size": 7890123,
51
- "dataset_size": 8901234,
52
- "task_categories": [
53
- "classification"
54
- ],
55
- "task_ids": [
56
- "binary_classification"
57
- ],
58
- "version": "1.0.0"
59
- }
60
- }
61
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
products/test-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ece099e826b10b8ac169357b631e70eb89fb60981d0ef4c2d2b2d23b799afa74
3
+ size 1775
products/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a8bc2fe7220c23d10a87c4b8ec92bb4615b9a10a7b5b6d34880b47b4e021c90
3
+ size 2620
products/validation-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9fa184616b9dbb077bae17a8e908b80327902c221609616a4067648031b9f8cd
3
+ size 1777
test.py DELETED
@@ -1,87 +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
- # set_trace()
38
- if self.config.name == "customers":
39
- features = datasets.Features(
40
- {
41
- "customer_id": datasets.Value("int64"),
42
- "name": datasets.Value("string"),
43
- "age": datasets.Value("int64"),
44
- }
45
- )
46
- elif self.config.name == "products":
47
- features = datasets.Features(
48
- {
49
- "product_id": datasets.Value("int64"),
50
- "name": datasets.Value("string"),
51
- "price": datasets.Value("double"),
52
- }
53
- )
54
- else:
55
- raise ValueError(f"Unknown subset: {self.config.name}")
56
-
57
- return datasets.DatasetInfo(
58
- description=_DESCRIPTION,
59
- features=features,
60
- supervised_keys=None,
61
- homepage=_HOMEPAGE,
62
- license=_LICENSE,
63
- citation=_CITATION,
64
- )
65
-
66
- def _split_generators(self, dl_manager):
67
- data_dir = os.path.join(self.config.data_dir, self.config.name)
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
- yield id_, item.to_dict()