mstz commited on
Commit
5243982
·
1 Parent(s): a56670d

updated to datasets 4.*

Browse files
Files changed (3) hide show
  1. README.md +13 -8
  2. pol.py +0 -111
  3. pol.csv → pol/train.csv +1 -1
README.md CHANGED
@@ -1,15 +1,20 @@
1
  ---
 
 
 
 
 
 
 
2
  license: cc
3
- task_categories:
4
- - tabular-classification
5
- language:
6
- - en
7
  tags:
8
- - openml
9
  - binary_classification
10
- pretty_name: Pol binary
11
- size_categories:
12
- - 10K<n<100K
13
  ---
14
  # Pol
15
  The [Pol dataset](https://www.openml.org/search?type=data&status=active&id=722) from the [OpenML repository](https://www.openml.org/).
 
1
  ---
2
+ configs:
3
+ - config_name: pol
4
+ data_files:
5
+ - path: pol/train.csv
6
+ split: train
7
+ default: true
8
+ language: en
9
  license: cc
10
+ pretty_name: Pol
11
+ size_categories: 1M<n<10M
 
 
12
  tags:
13
+ - tabular_classification
14
  - binary_classification
15
+ - multiclass_classification
16
+ task_categories:
17
+ - tabular-classification
18
  ---
19
  # Pol
20
  The [Pol dataset](https://www.openml.org/search?type=data&status=active&id=722) from the [OpenML repository](https://www.openml.org/).
pol.py DELETED
@@ -1,111 +0,0 @@
1
- from typing import List
2
-
3
- import datasets
4
-
5
- import pandas
6
-
7
-
8
- VERSION = datasets.Version("1.0.0")
9
-
10
-
11
- DESCRIPTION = "Pol dataset from the OpenML repository."
12
- _HOMEPAGE = "https://www.openml.org/search?type=data&sort=runs&id=722&status=active"
13
- _URLS = ("https://www.openml.org/search?type=data&sort=runs&id=722&status=active")
14
- _CITATION = """"""
15
-
16
- # Dataset info
17
- urls_per_split = {
18
- "train": "https://huggingface.co/datasets/mstz/pol/raw/main/pol.csv"
19
- }
20
- features_types_per_config = {
21
- "pol": {
22
- "f1": datasets.Value("int64"),
23
- "f2": datasets.Value("int64"),
24
- "f3": datasets.Value("int64"),
25
- "f4": datasets.Value("int64"),
26
- "f5": datasets.Value("int64"),
27
- "f6": datasets.Value("int64"),
28
- "f7": datasets.Value("int64"),
29
- "f8": datasets.Value("int64"),
30
- "f9": datasets.Value("int64"),
31
- "f10": datasets.Value("int64"),
32
- "f11": datasets.Value("int64"),
33
- "f12": datasets.Value("int64"),
34
- "f13": datasets.Value("int64"),
35
- "f14": datasets.Value("int64"),
36
- "f15": datasets.Value("int64"),
37
- "f16": datasets.Value("int64"),
38
- "f17": datasets.Value("int64"),
39
- "f18": datasets.Value("int64"),
40
- "f19": datasets.Value("int64"),
41
- "f20": datasets.Value("int64"),
42
- "f21": datasets.Value("int64"),
43
- "f22": datasets.Value("int64"),
44
- "f23": datasets.Value("int64"),
45
- "f24": datasets.Value("int64"),
46
- "f25": datasets.Value("int64"),
47
- "f26": datasets.Value("int64"),
48
- "f27": datasets.Value("int64"),
49
- "f28": datasets.Value("int64"),
50
- "f29": datasets.Value("int64"),
51
- "f30": datasets.Value("int64"),
52
- "f31": datasets.Value("int64"),
53
- "f32": datasets.Value("int64"),
54
- "f33": datasets.Value("int64"),
55
- "f34": datasets.Value("int64"),
56
- "f35": datasets.Value("int64"),
57
- "f36": datasets.Value("int64"),
58
- "f37": datasets.Value("int64"),
59
- "f38": datasets.Value("int64"),
60
- "f39": datasets.Value("int64"),
61
- "f40": datasets.Value("int64"),
62
- "f41": datasets.Value("int64"),
63
- "f42": datasets.Value("int64"),
64
- "f43": datasets.Value("int64"),
65
- "f44": datasets.Value("int64"),
66
- "f45": datasets.Value("int64"),
67
- "f46": datasets.Value("int64"),
68
- "f47": datasets.Value("int64"),
69
- "f48": datasets.Value("int64"),
70
- "class": datasets.ClassLabel(num_classes=2, names=("no", "yes"))
71
- }
72
-
73
- }
74
- features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
75
-
76
-
77
- class ElectricityConfig(datasets.BuilderConfig):
78
- def __init__(self, **kwargs):
79
- super(ElectricityConfig, self).__init__(version=VERSION, **kwargs)
80
- self.features = features_per_config[kwargs["name"]]
81
-
82
-
83
- class Electricity(datasets.GeneratorBasedBuilder):
84
- # dataset versions
85
- DEFAULT_CONFIG = "pol"
86
- BUILDER_CONFIGS = [
87
- ElectricityConfig(name="pol",
88
- description="Electricity for binary classification.")
89
- ]
90
-
91
-
92
- def _info(self):
93
- info = datasets.DatasetInfo(description=DESCRIPTION, citation=_CITATION, homepage=_HOMEPAGE,
94
- features=features_per_config[self.config.name])
95
-
96
- return info
97
-
98
- def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
99
- downloads = dl_manager.download_and_extract(urls_per_split)
100
-
101
- return [
102
- datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloads["train"]})
103
- ]
104
-
105
- def _generate_examples(self, filepath: str):
106
- data = pandas.read_csv(filepath)
107
-
108
- for row_id, row in data.iterrows():
109
- data_row = dict(row)
110
-
111
- yield row_id, data_row
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pol.csv → pol/train.csv RENAMED
@@ -14998,4 +14998,4 @@ f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f15,f16,f17,f18,f19,f20,f21,f22,f
14998
  110,100,100,100,16,137,145,71,94,0,0,0,0,1,2,0,0,0,0,0,0,51,29,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
14999
  110,100,100,100,123,77,76,71,94,0,0,0,17,38,0,25,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
15000
  110,100,100,100,18,118,78,71,94,0,0,0,3,0,0,0,3,0,0,0,38,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
15001
- 110,100,100,100,141,108,76,71,94,0,0,0,31,31,0,0,62,0,4,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
 
14998
  110,100,100,100,16,137,145,71,94,0,0,0,0,1,2,0,0,0,0,0,0,51,29,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
14999
  110,100,100,100,123,77,76,71,94,0,0,0,17,38,0,25,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
15000
  110,100,100,100,18,118,78,71,94,0,0,0,3,0,0,0,3,0,0,0,38,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
15001
+ 110,100,100,100,141,108,76,71,94,0,0,0,31,31,0,0,62,0,4,40,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1