mstz commited on
Commit
8bd25e7
1 Parent(s): 2b5860e

Upload 3 files

Browse files
Files changed (3) hide show
  1. README.md +28 -1
  2. house16.py +79 -0
  3. house_16H.csv +0 -0
README.md CHANGED
@@ -1,3 +1,30 @@
1
  ---
2
- license: cc-by-4.0
 
 
 
 
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - en
4
+ tags:
5
+ - house16
6
+ - tabular_classification
7
+ - binary_classification
8
+ pretty_name: House16
9
+ size_categories:
10
+ - 10k<n<100K
11
+ task_categories: # Full list at https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Types.ts
12
+ - tabular-classification
13
+ configs:
14
+ - house16
15
  ---
16
+ # House16
17
+ The [House16 dataset](https://www.openml.org/search?type=data&sort=runs&id=821&status=active) from the [OpenML repository](https://www.openml.org/).
18
+
19
+ # Configurations and tasks
20
+ | **Configuration** | **Task** |
21
+ |-------------------|---------------------------|
22
+ | house16 | Binary classification |
23
+
24
+
25
+ # Usage
26
+ ```python
27
+ from datasets import load_dataset
28
+
29
+ dataset = load_dataset("mstz/house16", "house16")["train"]
30
+ ```
house16.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = "House16 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/house16/raw/main/house_16H.csv"
19
+ }
20
+ features_types_per_config = {
21
+ "house16": {
22
+ "P1": datasets.Value("int64"),
23
+ "P5p1": datasets.Value("float64"),
24
+ "P6p2": datasets.Value("float64"),
25
+ "P11p4": datasets.Value("float64"),
26
+ "P14p9": datasets.Value("float64"),
27
+ "P15p1": datasets.Value("float64"),
28
+ "P15p3": datasets.Value("float64"),
29
+ "P16p2": datasets.Value("float64"),
30
+ "P18p2": datasets.Value("float64"),
31
+ "P27p4": datasets.Value("float64"),
32
+ "H2p2": datasets.Value("float64"),
33
+ "H8p2": datasets.Value("float64"),
34
+ "H10p1": datasets.Value("float64"),
35
+ "H13p1": datasets.Value("float64"),
36
+ "H18pA": datasets.Value("float64"),
37
+ "H40p4": datasets.Value("float64"),
38
+ "binaryClass": datasets.ClassLabel(num_classes=2, names=("no", "yes"))
39
+ }
40
+
41
+ }
42
+ features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
43
+
44
+
45
+ class House16Config(datasets.BuilderConfig):
46
+ def __init__(self, **kwargs):
47
+ super(House16Config, self).__init__(version=VERSION, **kwargs)
48
+ self.features = features_per_config[kwargs["name"]]
49
+
50
+
51
+ class House16(datasets.GeneratorBasedBuilder):
52
+ # dataset versions
53
+ DEFAULT_CONFIG = "house16"
54
+ BUILDER_CONFIGS = [
55
+ House16Config(name="house16",
56
+ description="House16 for binary classification.")
57
+ ]
58
+
59
+
60
+ def _info(self):
61
+ info = datasets.DatasetInfo(description=DESCRIPTION, citation=_CITATION, homepage=_HOMEPAGE,
62
+ features=features_per_config[self.config.name])
63
+
64
+ return info
65
+
66
+ def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
67
+ downloads = dl_manager.download_and_extract(urls_per_split)
68
+
69
+ return [
70
+ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloads["train"]})
71
+ ]
72
+
73
+ def _generate_examples(self, filepath: str):
74
+ data = pandas.read_csv(filepath)
75
+
76
+ for row_id, row in data.iterrows():
77
+ data_row = dict(row)
78
+
79
+ yield row_id, data_row
house_16H.csv ADDED
The diff for this file is too large to render. See raw diff