Convert dataset to Parquet

#11
by iszhaoxin - opened
.DS_Store DELETED
Binary file (6.15 kB)
 
README.md CHANGED
@@ -17,8 +17,65 @@ task_categories:
17
  - other
18
  task_ids:
19
  - natural-language-inference
20
- paperswithcode_id: null
21
  pretty_name: test
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  ---
23
 
24
  # Dataset Card for test
 
17
  - other
18
  task_ids:
19
  - natural-language-inference
 
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
dummy_data.zip → customers/test-00000-of-00001.parquet RENAMED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:62ac49720a8a94b6f27b0c575a2004176ded5fa78399c2b03a4fa4cda119d9ea
3
- size 3631
 
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/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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/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:0a8bc2fe7220c23d10a87c4b8ec92bb4615b9a10a7b5b6d34880b47b4e021c90
3
+ size 2620
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/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:9fa184616b9dbb077bae17a8e908b80327902c221609616a4067648031b9f8cd
3
+ size 1777
test.ipynb DELETED
@@ -1,81 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "code",
5
- "execution_count": 1,
6
- "metadata": {},
7
- "outputs": [
8
- {
9
- "name": "stderr",
10
- "output_type": "stream",
11
- "text": [
12
- "/Users/xinzhao/anaconda3/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
13
- " from .autonotebook import tqdm as notebook_tqdm\n",
14
- "Using the latest cached version of the module from /Users/xinzhao/.cache/huggingface/modules/datasets_modules/datasets/iszhaoxin--test/ca8172e7372b0c39741729fdfe907438e4d8633843d1f170ac4d65686e2e2300 (last modified on Tue Nov 19 09:59:57 2024) since it couldn't be found locally at iszhaoxin/test, or remotely on the Hugging Face Hub.\n"
15
- ]
16
- }
17
- ],
18
- "source": [
19
- "from datasets import load_dataset\n",
20
- "dataset = load_dataset('iszhaoxin/test', name='customers') # Replace 'customers' with the appropriate subset name\n"
21
- ]
22
- },
23
- {
24
- "cell_type": "code",
25
- "execution_count": 3,
26
- "metadata": {},
27
- "outputs": [],
28
- "source": [
29
- "from datasets import get_dataset_config_names"
30
- ]
31
- },
32
- {
33
- "cell_type": "code",
34
- "execution_count": 4,
35
- "metadata": {},
36
- "outputs": [
37
- {
38
- "data": {
39
- "text/plain": [
40
- "['default']"
41
- ]
42
- },
43
- "execution_count": 4,
44
- "metadata": {},
45
- "output_type": "execute_result"
46
- }
47
- ],
48
- "source": [
49
- "get_dataset_config_names(\"iszhaoxin/test\")"
50
- ]
51
- },
52
- {
53
- "cell_type": "code",
54
- "execution_count": null,
55
- "metadata": {},
56
- "outputs": [],
57
- "source": []
58
- }
59
- ],
60
- "metadata": {
61
- "kernelspec": {
62
- "display_name": "base",
63
- "language": "python",
64
- "name": "python3"
65
- },
66
- "language_info": {
67
- "codemirror_mode": {
68
- "name": "ipython",
69
- "version": 3
70
- },
71
- "file_extension": ".py",
72
- "mimetype": "text/x-python",
73
- "name": "python",
74
- "nbconvert_exporter": "python",
75
- "pygments_lexer": "ipython3",
76
- "version": "3.10.9"
77
- }
78
- },
79
- "nbformat": 4,
80
- "nbformat_minor": 2
81
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- version=datasets.Version("1.0.0"),
27
- description="This is subset A"),
28
- datasets.BuilderConfig(
29
- name="products",
30
- version=datasets.Version("1.0.0"),
31
- description="This is subset B"),
32
- ]
33
-
34
- def _info(self):
35
- # set_trace()
36
- if self.config.name == "customers":
37
- features = datasets.Features(
38
- {
39
- "customer_id": datasets.Value("int64"),
40
- "name": datasets.Value("string"),
41
- "age": datasets.Value("int64"),
42
- }
43
- )
44
- elif self.config.name == "products":
45
- features = datasets.Features(
46
- {
47
- "product_id": datasets.Value("int64"),
48
- "name": datasets.Value("string"),
49
- "price": datasets.Value("double"),
50
- }
51
- )
52
- else:
53
- raise ValueError(f"Unknown subset: {self.config.name}")
54
-
55
- return datasets.DatasetInfo(
56
- description=_DESCRIPTION,
57
- features=features,
58
- supervised_keys=None,
59
- homepage=_HOMEPAGE,
60
- license=_LICENSE,
61
- citation=_CITATION,
62
- )
63
-
64
- def _split_generators(self, dl_manager):
65
- data_dir = dl_manager.manual_dir or "./"
66
- data_dir = os.path.join(data_dir, self.config.name)
67
- return [
68
- datasets.SplitGenerator(
69
- name=datasets.Split.TRAIN,
70
- gen_kwargs={"filepath": os.path.join(data_dir, "train.csv")},
71
- ),
72
- datasets.SplitGenerator(
73
- name=datasets.Split.VALIDATION,
74
- gen_kwargs={"filepath": os.path.join(data_dir, "val.csv")},
75
- ),
76
- datasets.SplitGenerator(
77
- name=datasets.Split.TEST,
78
- gen_kwargs={"filepath": os.path.join(data_dir, "test.csv")},
79
- ),
80
- ]
81
-
82
- def _generate_examples(self, filepath):
83
- # set_trace()
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()