Datasets:
Upload 4 files
Browse files- Hill_Valley_without_noise_Testing.data +0 -0
- Hill_Valley_without_noise_Training.data +0 -0
- README.md +32 -1
- hill.py +172 -0
Hill_Valley_without_noise_Testing.data
ADDED
The diff for this file is too large to render.
See raw diff
|
|
Hill_Valley_without_noise_Training.data
ADDED
The diff for this file is too large to render.
See raw diff
|
|
README.md
CHANGED
@@ -1,3 +1,34 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- hill
|
6 |
+
- tabular_classification
|
7 |
+
- binary_classification
|
8 |
+
pretty_name: Hill
|
9 |
+
size_categories:
|
10 |
+
- 100<n<1K
|
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 |
+
- hill
|
15 |
+
|
16 |
---
|
17 |
+
# Hill
|
18 |
+
The [Hill dataset](https://archive.ics.uci.edu/ml/datasets/Hill) from the [UCI ML repository](https://archive.ics.uci.edu/ml/datasets).
|
19 |
+
Do the plotted coordinates draw a hill?
|
20 |
+
|
21 |
+
# Configurations and tasks
|
22 |
+
| **Configuration** | **Task** | **Description** |
|
23 |
+
|-------------------|---------------------------|------------------------------------------|
|
24 |
+
| hill | Binary classification | Do the plotted coordinates draw a hill? |
|
25 |
+
|
26 |
+
# Usage
|
27 |
+
```python
|
28 |
+
from datasets import load_dataset
|
29 |
+
|
30 |
+
dataset = load_dataset("mstz/hill", "hill")["train"]
|
31 |
+
```
|
32 |
+
|
33 |
+
# Features
|
34 |
+
Features are the coordinates of the drawn point. Feature `X{i}` is the `y` coordinate of the point `(i, X{i})`.
|
hill.py
ADDED
@@ -0,0 +1,172 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Hill"""
|
2 |
+
|
3 |
+
from typing import List
|
4 |
+
|
5 |
+
import datasets
|
6 |
+
|
7 |
+
import pandas
|
8 |
+
|
9 |
+
|
10 |
+
VERSION = datasets.Version("1.0.0")
|
11 |
+
|
12 |
+
DESCRIPTION = "Hill dataset from the UCI ML repository."
|
13 |
+
_HOMEPAGE = "https://archive.ics.uci.edu/ml/datasets/Hill"
|
14 |
+
_URLS = ("https://archive.ics.uci.edu/ml/datasets/Hill")
|
15 |
+
_CITATION = """
|
16 |
+
@misc{misc_hill-valley_166,
|
17 |
+
author = {Graham,Lee & Oppacher,Franz},
|
18 |
+
title = {{Hill-Valley}},
|
19 |
+
year = {2008},
|
20 |
+
howpublished = {UCI Machine Learning Repository},
|
21 |
+
note = {{DOI}: \\url{10.24432/C5JC8P}}
|
22 |
+
}"""
|
23 |
+
|
24 |
+
# Dataset info
|
25 |
+
urls_per_split = {
|
26 |
+
"train": "Hill_Valley_without_noise_Training.data",
|
27 |
+
"test": "Hill_Valley_without_noise_Testing.data"
|
28 |
+
}
|
29 |
+
features_types_per_config = {
|
30 |
+
"hill": {
|
31 |
+
"X1": datasets.Value("float64"),
|
32 |
+
"X2": datasets.Value("float64"),
|
33 |
+
"X3": datasets.Value("float64"),
|
34 |
+
"X4": datasets.Value("float64"),
|
35 |
+
"X5": datasets.Value("float64"),
|
36 |
+
"X6": datasets.Value("float64"),
|
37 |
+
"X7": datasets.Value("float64"),
|
38 |
+
"X8": datasets.Value("float64"),
|
39 |
+
"X9": datasets.Value("float64"),
|
40 |
+
"X10": datasets.Value("float64"),
|
41 |
+
"X11": datasets.Value("float64"),
|
42 |
+
"X12": datasets.Value("float64"),
|
43 |
+
"X13": datasets.Value("float64"),
|
44 |
+
"X14": datasets.Value("float64"),
|
45 |
+
"X15": datasets.Value("float64"),
|
46 |
+
"X16": datasets.Value("float64"),
|
47 |
+
"X17": datasets.Value("float64"),
|
48 |
+
"X18": datasets.Value("float64"),
|
49 |
+
"X19": datasets.Value("float64"),
|
50 |
+
"X20": datasets.Value("float64"),
|
51 |
+
"X21": datasets.Value("float64"),
|
52 |
+
"X22": datasets.Value("float64"),
|
53 |
+
"X23": datasets.Value("float64"),
|
54 |
+
"X24": datasets.Value("float64"),
|
55 |
+
"X25": datasets.Value("float64"),
|
56 |
+
"X26": datasets.Value("float64"),
|
57 |
+
"X27": datasets.Value("float64"),
|
58 |
+
"X28": datasets.Value("float64"),
|
59 |
+
"X29": datasets.Value("float64"),
|
60 |
+
"X30": datasets.Value("float64"),
|
61 |
+
"X31": datasets.Value("float64"),
|
62 |
+
"X32": datasets.Value("float64"),
|
63 |
+
"X33": datasets.Value("float64"),
|
64 |
+
"X34": datasets.Value("float64"),
|
65 |
+
"X35": datasets.Value("float64"),
|
66 |
+
"X36": datasets.Value("float64"),
|
67 |
+
"X37": datasets.Value("float64"),
|
68 |
+
"X38": datasets.Value("float64"),
|
69 |
+
"X39": datasets.Value("float64"),
|
70 |
+
"X40": datasets.Value("float64"),
|
71 |
+
"X41": datasets.Value("float64"),
|
72 |
+
"X42": datasets.Value("float64"),
|
73 |
+
"X43": datasets.Value("float64"),
|
74 |
+
"X44": datasets.Value("float64"),
|
75 |
+
"X45": datasets.Value("float64"),
|
76 |
+
"X46": datasets.Value("float64"),
|
77 |
+
"X47": datasets.Value("float64"),
|
78 |
+
"X48": datasets.Value("float64"),
|
79 |
+
"X49": datasets.Value("float64"),
|
80 |
+
"X50": datasets.Value("float64"),
|
81 |
+
"X51": datasets.Value("float64"),
|
82 |
+
"X52": datasets.Value("float64"),
|
83 |
+
"X53": datasets.Value("float64"),
|
84 |
+
"X54": datasets.Value("float64"),
|
85 |
+
"X55": datasets.Value("float64"),
|
86 |
+
"X56": datasets.Value("float64"),
|
87 |
+
"X57": datasets.Value("float64"),
|
88 |
+
"X58": datasets.Value("float64"),
|
89 |
+
"X59": datasets.Value("float64"),
|
90 |
+
"X60": datasets.Value("float64"),
|
91 |
+
"X61": datasets.Value("float64"),
|
92 |
+
"X62": datasets.Value("float64"),
|
93 |
+
"X63": datasets.Value("float64"),
|
94 |
+
"X64": datasets.Value("float64"),
|
95 |
+
"X65": datasets.Value("float64"),
|
96 |
+
"X66": datasets.Value("float64"),
|
97 |
+
"X67": datasets.Value("float64"),
|
98 |
+
"X68": datasets.Value("float64"),
|
99 |
+
"X69": datasets.Value("float64"),
|
100 |
+
"X70": datasets.Value("float64"),
|
101 |
+
"X71": datasets.Value("float64"),
|
102 |
+
"X72": datasets.Value("float64"),
|
103 |
+
"X73": datasets.Value("float64"),
|
104 |
+
"X74": datasets.Value("float64"),
|
105 |
+
"X75": datasets.Value("float64"),
|
106 |
+
"X76": datasets.Value("float64"),
|
107 |
+
"X77": datasets.Value("float64"),
|
108 |
+
"X78": datasets.Value("float64"),
|
109 |
+
"X79": datasets.Value("float64"),
|
110 |
+
"X80": datasets.Value("float64"),
|
111 |
+
"X81": datasets.Value("float64"),
|
112 |
+
"X82": datasets.Value("float64"),
|
113 |
+
"X83": datasets.Value("float64"),
|
114 |
+
"X84": datasets.Value("float64"),
|
115 |
+
"X85": datasets.Value("float64"),
|
116 |
+
"X86": datasets.Value("float64"),
|
117 |
+
"X87": datasets.Value("float64"),
|
118 |
+
"X88": datasets.Value("float64"),
|
119 |
+
"X89": datasets.Value("float64"),
|
120 |
+
"X90": datasets.Value("float64"),
|
121 |
+
"X91": datasets.Value("float64"),
|
122 |
+
"X92": datasets.Value("float64"),
|
123 |
+
"X93": datasets.Value("float64"),
|
124 |
+
"X94": datasets.Value("float64"),
|
125 |
+
"X95": datasets.Value("float64"),
|
126 |
+
"X96": datasets.Value("float64"),
|
127 |
+
"X97": datasets.Value("float64"),
|
128 |
+
"X98": datasets.Value("float64"),
|
129 |
+
"X99": datasets.Value("float64"),
|
130 |
+
"X100": datasets.Value("float64"),
|
131 |
+
"class": datasets.ClassLabel(num_classes=2)
|
132 |
+
}
|
133 |
+
}
|
134 |
+
features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
|
135 |
+
|
136 |
+
|
137 |
+
class HillConfig(datasets.BuilderConfig):
|
138 |
+
def __init__(self, **kwargs):
|
139 |
+
super(HillConfig, self).__init__(version=VERSION, **kwargs)
|
140 |
+
self.features = features_per_config[kwargs["name"]]
|
141 |
+
|
142 |
+
|
143 |
+
class Hill(datasets.GeneratorBasedBuilder):
|
144 |
+
# dataset versions
|
145 |
+
DEFAULT_CONFIG = "hill"
|
146 |
+
BUILDER_CONFIGS = [
|
147 |
+
HillConfig(name="hill",
|
148 |
+
description="Hill for binary classification."),
|
149 |
+
]
|
150 |
+
|
151 |
+
|
152 |
+
def _info(self):
|
153 |
+
info = datasets.DatasetInfo(description=DESCRIPTION, citation=_CITATION, homepage=_HOMEPAGE,
|
154 |
+
features=features_per_config[self.config.name])
|
155 |
+
|
156 |
+
return info
|
157 |
+
|
158 |
+
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
159 |
+
downloads = dl_manager.download_and_extract(urls_per_split)
|
160 |
+
|
161 |
+
return [
|
162 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloads["train"]}),
|
163 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloads["test"]}),
|
164 |
+
]
|
165 |
+
|
166 |
+
def _generate_examples(self, filepath: str):
|
167 |
+
data = pandas.read_csv(filepath)
|
168 |
+
|
169 |
+
for row_id, row in data.iterrows():
|
170 |
+
data_row = dict(row)
|
171 |
+
|
172 |
+
yield row_id, data_row
|