Datasets:
Upload 3 files
Browse files- .gitattributes +1 -0
- README.md +31 -1
- isolet.py +76 -0
- isolet1+2+3+4.data +3 -0
.gitattributes
CHANGED
@@ -52,3 +52,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
|
|
|
52 |
*.jpg filter=lfs diff=lfs merge=lfs -text
|
53 |
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
54 |
*.webp filter=lfs diff=lfs merge=lfs -text
|
55 |
+
isolet1+2+3+4.data filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,3 +1,33 @@
|
|
1 |
---
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
tags:
|
5 |
+
- isolet
|
6 |
+
- tabular_classification
|
7 |
+
- binary_classification
|
8 |
+
- multiclass_classification
|
9 |
+
pretty_name: Isolet
|
10 |
+
size_categories:
|
11 |
+
- 1K<n<10K
|
12 |
+
task_categories: # Full list at https://github.com/huggingface/hub-docs/blob/main/js/src/lib/interfaces/Types.ts
|
13 |
+
- tabular-classification
|
14 |
+
configs:
|
15 |
+
- isolet
|
16 |
+
|
17 |
---
|
18 |
+
# Isolet
|
19 |
+
The [Isolet dataset](https://archive-beta.ics.uci.edu/dataset/54/isolet) from the [UCI ML repository](https://archive.ics.uci.edu/ml/datasets).
|
20 |
+
|
21 |
+
|
22 |
+
# Configurations and tasks
|
23 |
+
| **Configuration** | **Task** | Description |
|
24 |
+
|-------------------|---------------------------|--------------------------|
|
25 |
+
| isolet | Multiclass classification | What letter was uttered? |
|
26 |
+
|
27 |
+
# Usage
|
28 |
+
```
|
29 |
+
from datasets import load_dataset
|
30 |
+
from sklearn.tree import DecisionTreeClassifier
|
31 |
+
|
32 |
+
dataset = load_dataset("mstz/isolet", "isolet")["train"]
|
33 |
+
```
|
isolet.py
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Isolet dataset."""
|
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 = "Isolet dataset from the UCI ML repository."
|
13 |
+
_HOMEPAGE = "https://archive.ics.uci.edu/ml/datasets/Isolet"
|
14 |
+
_URLS = ("https://archive-beta.ics.uci.edu/dataset/54/isolet")
|
15 |
+
_CITATION = """
|
16 |
+
@misc{misc_isolet_54,
|
17 |
+
author = {Cole,Ron & Fanty,Mark},
|
18 |
+
title = {{ISOLET}},
|
19 |
+
year = {1994},
|
20 |
+
howpublished = {UCI Machine Learning Repository},
|
21 |
+
note = {{DOI}: \url{10.24432/C51G69}}
|
22 |
+
}"""
|
23 |
+
|
24 |
+
# Dataset info
|
25 |
+
urls_per_split = {
|
26 |
+
"train": "https://huggingface.co/datasets/mstz/isolet/raw/main/isolet1+2+3+4.data"
|
27 |
+
}
|
28 |
+
features_types_per_config = {
|
29 |
+
"isolet": {
|
30 |
+
str(i): datasets.Value("float64") for i in range(617)
|
31 |
+
}
|
32 |
+
}
|
33 |
+
features_types_per_config["isolet"]["618"] = datasets.ClassLabel(num_classes=26)
|
34 |
+
features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
|
35 |
+
|
36 |
+
|
37 |
+
class IsoletConfig(datasets.BuilderConfig):
|
38 |
+
def __init__(self, **kwargs):
|
39 |
+
super(IsoletConfig, self).__init__(version=VERSION, **kwargs)
|
40 |
+
self.features = features_per_config[kwargs["name"]]
|
41 |
+
|
42 |
+
|
43 |
+
class Isolet(datasets.GeneratorBasedBuilder):
|
44 |
+
# dataset versions
|
45 |
+
DEFAULT_CONFIG = "isolet"
|
46 |
+
BUILDER_CONFIGS = [
|
47 |
+
IsoletConfig(name="isolet",
|
48 |
+
description="Isolet for letter classification."),
|
49 |
+
]
|
50 |
+
|
51 |
+
|
52 |
+
def _info(self):
|
53 |
+
info = datasets.DatasetInfo(description=DESCRIPTION, citation=_CITATION, homepage=_HOMEPAGE,
|
54 |
+
features=features_per_config[self.config.name])
|
55 |
+
|
56 |
+
return info
|
57 |
+
|
58 |
+
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
59 |
+
downloads = dl_manager.download_and_extract(urls_per_split)
|
60 |
+
|
61 |
+
return [
|
62 |
+
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloads["train"]})
|
63 |
+
]
|
64 |
+
|
65 |
+
def _generate_examples(self, filepath: str):
|
66 |
+
data = pandas.read_csv(filepath, header=None)
|
67 |
+
data = self.preprocess(data, config=self.config.name)
|
68 |
+
|
69 |
+
for row_id, row in data.iterrows():
|
70 |
+
data_row = dict(row)
|
71 |
+
|
72 |
+
yield row_id, data_row
|
73 |
+
|
74 |
+
def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
|
75 |
+
data.columns = [str(i) for i in range(618)]
|
76 |
+
return data.astype({"618": "int"})
|
isolet1+2+3+4.data
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aa935cc98ec22ee689aa5b2ddf1fdce074692f7016f0255f0982df133ccbab38
|
3 |
+
size 32445949
|