Datasets:
parquet-converter
commited on
Commit
•
9bf85bd
1
Parent(s):
46c9629
Update parquet files
Browse files- README.md +0 -56
- acute_inflammation.py +0 -103
- diagnosis.csv +0 -120
- diagnosis.data +0 -0
- inflammation/acute_inflammation-train.parquet +3 -0
README.md
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
---
|
2 |
-
language:
|
3 |
-
- en
|
4 |
-
tags:
|
5 |
-
- adult
|
6 |
-
- tabular_classification
|
7 |
-
- binary_classification
|
8 |
-
- multiclass_classification
|
9 |
-
pretty_name: Adult
|
10 |
-
size_categories:
|
11 |
-
- 10K<n<100K
|
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 |
-
- encoding
|
16 |
-
- income
|
17 |
-
- income-no race
|
18 |
-
- race
|
19 |
-
---
|
20 |
-
# Adult
|
21 |
-
The [Adult dataset](https://archive.ics.uci.edu/ml/datasets/Adult) from the [UCI ML repository](https://archive.ics.uci.edu/ml/datasets).
|
22 |
-
Census dataset including personal characteristic of a person, and their income threshold.
|
23 |
-
|
24 |
-
# Configurations and tasks
|
25 |
-
| **Configuration** | **Task** | Description |
|
26 |
-
|-------------------|---------------------------|---------------------------------------------------------------|
|
27 |
-
| encoding | | Encoding dictionary |
|
28 |
-
| income | Binary classification | Classify the person's income as over or under the threshold. |
|
29 |
-
| income-no race | Binary classification | As `income`, but the `race` feature is removed. |
|
30 |
-
| race | Multiclass classification | Predict the race of the individual. |
|
31 |
-
|
32 |
-
# Usage
|
33 |
-
```
|
34 |
-
from datasets import load_dataset
|
35 |
-
from sklearn.tree import DecisionTreeClassifier
|
36 |
-
|
37 |
-
dataset = load_dataset("mstz/adult", "income")["train"]
|
38 |
-
```
|
39 |
-
|
40 |
-
# Features
|
41 |
-
|**Feature** |**Type** | **Description** |
|
42 |
-
|-------------------|-----------|-----------------------------------------------------------|
|
43 |
-
|`age` |`[int64]` | Age of the person |
|
44 |
-
|`capital_gain` |`[float64]`| Capital gained by the person |
|
45 |
-
|`capital_loss` |`[float64]`| Capital lost by the person |
|
46 |
-
|`education` |`[int8]` | Education level: the higher, the more educated the person |
|
47 |
-
|`final_weight` |`[int64]` | |
|
48 |
-
|`hours_per_week` |`[int64]` | Hours worked per week |
|
49 |
-
|`marital_status` |`[string]` | Marital status of the person |
|
50 |
-
|`native_country` |`[string]` | Native country of the person |
|
51 |
-
|`occupation` |`[string]` | Job of the person |
|
52 |
-
|`race` |`[string]` | Race of the person |
|
53 |
-
|`relationship` |`[string]` | |
|
54 |
-
|`sex` |`[int8]` | Sex of the person |
|
55 |
-
|`workclass` |`[string]` | Type of job of the person |
|
56 |
-
|`over_threshold` |`int8` |`1` for income `>= 50k$`, `0` otherwise |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
acute_inflammation.py
DELETED
@@ -1,103 +0,0 @@
|
|
1 |
-
"""Acute_Inflammation"""
|
2 |
-
|
3 |
-
from typing import List
|
4 |
-
|
5 |
-
import datasets
|
6 |
-
|
7 |
-
import pandas
|
8 |
-
|
9 |
-
|
10 |
-
VERSION = datasets.Version("1.0.0")
|
11 |
-
_BASE_FEATURE_NAMES = [
|
12 |
-
"temperature",
|
13 |
-
"has_nausea",
|
14 |
-
"has_lumbar_pain",
|
15 |
-
"has_urine_pushing",
|
16 |
-
"has_micturition_pains",
|
17 |
-
"has_burnt_urethra",
|
18 |
-
"has_inflammed_bladder",
|
19 |
-
"has_nephritis_of_renal_pelvis",
|
20 |
-
"has_acute_inflammation"
|
21 |
-
]
|
22 |
-
|
23 |
-
DESCRIPTION = "Acute_Inflammation dataset from the UCI ML repository."
|
24 |
-
_HOMEPAGE = "https://archive.ics.uci.edu/ml/datasets/Acute_Inflammation"
|
25 |
-
_URLS = ("https://huggingface.co/datasets/mstz/acute_inflammation/raw/main/diagnosis.csv")
|
26 |
-
_CITATION = """
|
27 |
-
@misc{misc_acute_inflammations_184,
|
28 |
-
author = {Czerniak,Jacek},
|
29 |
-
title = {{Acute Inflammations}},
|
30 |
-
year = {2009},
|
31 |
-
howpublished = {UCI Machine Learning Repository},
|
32 |
-
note = {{DOI}: \\url{10.24432/C5V59S}}
|
33 |
-
}"""
|
34 |
-
|
35 |
-
# Dataset info
|
36 |
-
urls_per_split = {
|
37 |
-
"train": "https://huggingface.co/datasets/mstz/acute_inflammation/raw/main/diagnosis.csv"
|
38 |
-
}
|
39 |
-
features_types_per_config = {
|
40 |
-
"inflammation": {
|
41 |
-
"temperature": datasets.Value("float64"),
|
42 |
-
"has_nausea": datasets.Value("bool"),
|
43 |
-
"has_lumbar_pain": datasets.Value("bool"),
|
44 |
-
"has_urine_pushing": datasets.Value("bool"),
|
45 |
-
"has_micturition_pains": datasets.Value("bool"),
|
46 |
-
"has_burnt_urethra": datasets.Value("bool"),
|
47 |
-
"has_inflammed_bladder": datasets.Value("bool"),
|
48 |
-
"has_nephritis_of_renal_pelvis": datasets.Value("bool"),
|
49 |
-
"has_acute_inflammation": datasets.ClassLabel(num_classes=2)
|
50 |
-
}
|
51 |
-
}
|
52 |
-
features_per_config = {k: datasets.Features(features_types_per_config[k]) for k in features_types_per_config}
|
53 |
-
|
54 |
-
|
55 |
-
class Acute_InflammationConfig(datasets.BuilderConfig):
|
56 |
-
def __init__(self, **kwargs):
|
57 |
-
super(Acute_InflammationConfig, self).__init__(version=VERSION, **kwargs)
|
58 |
-
self.features = features_per_config[kwargs["name"]]
|
59 |
-
|
60 |
-
|
61 |
-
class Acute_Inflammation(datasets.GeneratorBasedBuilder):
|
62 |
-
# dataset versions
|
63 |
-
DEFAULT_CONFIG = "inflammation"
|
64 |
-
BUILDER_CONFIGS = [
|
65 |
-
Acute_InflammationConfig(name="inflammation",
|
66 |
-
description="Binary classification of inflammation.")
|
67 |
-
]
|
68 |
-
|
69 |
-
|
70 |
-
def _info(self):
|
71 |
-
info = datasets.DatasetInfo(description=DESCRIPTION, citation=_CITATION, homepage=_HOMEPAGE,
|
72 |
-
features=features_per_config[self.config.name])
|
73 |
-
|
74 |
-
return info
|
75 |
-
|
76 |
-
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
77 |
-
downloads = dl_manager.download_and_extract(urls_per_split)
|
78 |
-
|
79 |
-
return [
|
80 |
-
datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": downloads["train"]})
|
81 |
-
]
|
82 |
-
|
83 |
-
def _generate_examples(self, filepath: str):
|
84 |
-
data = pandas.read_csv(filepath, header=None)
|
85 |
-
data = self.preprocess(data, config=self.config.name)
|
86 |
-
|
87 |
-
for row_id, row in data.iterrows():
|
88 |
-
data_row = dict(row)
|
89 |
-
|
90 |
-
yield row_id, data_row
|
91 |
-
|
92 |
-
def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
|
93 |
-
data.columns = _BASE_FEATURE_NAMES
|
94 |
-
boolean_features = ["has_nausea", "has_lumbar_pain", "has_urine_pushing",
|
95 |
-
"has_micturition_pains", "has_burnt_urethra", "has_inflammed_bladder",
|
96 |
-
"has_nephritis_of_renal_pelvis", "has_acute_inflammation"]
|
97 |
-
for f in boolean_features:
|
98 |
-
data.loc[:, f] = data[f].apply(lambda x: True if x == "yes" else False)
|
99 |
-
|
100 |
-
data = data.astype({f: "bool" for f in boolean_features})
|
101 |
-
data = data.astype({"has_acute_inflammation": int})
|
102 |
-
|
103 |
-
return data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
diagnosis.csv
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
35,5,no,yes,no,no,no,no,no
|
2 |
-
35,9,no,no,yes,yes,yes,yes,no
|
3 |
-
35,9,no,yes,no,no,no,no,no
|
4 |
-
36,0,no,no,yes,yes,yes,yes,no
|
5 |
-
36,0,no,yes,no,no,no,no,no
|
6 |
-
36,0,no,yes,no,no,no,no,no
|
7 |
-
36,2,no,no,yes,yes,yes,yes,no
|
8 |
-
36,2,no,yes,no,no,no,no,no
|
9 |
-
36,3,no,no,yes,yes,yes,yes,no
|
10 |
-
36,6,no,no,yes,yes,yes,yes,no
|
11 |
-
36,6,no,no,yes,yes,yes,yes,no
|
12 |
-
36,6,no,yes,no,no,no,no,no
|
13 |
-
36,6,no,yes,no,no,no,no,no
|
14 |
-
36,7,no,no,yes,yes,yes,yes,no
|
15 |
-
36,7,no,yes,no,no,no,no,no
|
16 |
-
36,7,no,yes,no,no,no,no,no
|
17 |
-
36,8,no,no,yes,yes,yes,yes,no
|
18 |
-
36,8,no,no,yes,yes,yes,yes,no
|
19 |
-
36,9,no,no,yes,yes,yes,yes,no
|
20 |
-
36,9,no,yes,no,no,no,no,no
|
21 |
-
37,0,no,no,yes,yes,no,yes,no
|
22 |
-
37,0,no,no,yes,yes,no,yes,no
|
23 |
-
37,0,no,yes,no,no,no,no,no
|
24 |
-
37,0,no,no,yes,yes,yes,yes,no
|
25 |
-
37,0,no,no,yes,yes,yes,yes,no
|
26 |
-
37,0,no,no,yes,yes,yes,yes,no
|
27 |
-
37,0,no,no,yes,yes,yes,yes,no
|
28 |
-
37,0,no,no,yes,no,no,yes,no
|
29 |
-
37,1,no,yes,no,no,no,no,no
|
30 |
-
37,1,no,no,yes,yes,yes,yes,no
|
31 |
-
37,1,no,no,yes,no,no,yes,no
|
32 |
-
37,2,no,no,yes,yes,no,yes,no
|
33 |
-
37,2,no,yes,no,no,no,no,no
|
34 |
-
37,2,no,no,yes,no,no,yes,no
|
35 |
-
37,3,no,yes,no,no,no,no,no
|
36 |
-
37,3,no,no,yes,yes,yes,yes,no
|
37 |
-
37,3,no,no,yes,no,no,yes,no
|
38 |
-
37,4,no,yes,no,no,no,no,no
|
39 |
-
37,4,no,no,yes,no,no,yes,no
|
40 |
-
37,5,no,no,yes,yes,no,yes,no
|
41 |
-
37,5,no,yes,no,no,no,no,no
|
42 |
-
37,5,no,yes,no,no,no,no,no
|
43 |
-
37,5,no,no,yes,yes,yes,yes,no
|
44 |
-
37,5,no,no,yes,no,no,yes,no
|
45 |
-
37,5,no,no,yes,no,no,yes,no
|
46 |
-
37,6,no,no,yes,yes,no,yes,no
|
47 |
-
37,6,no,no,yes,yes,no,yes,no
|
48 |
-
37,6,no,no,yes,yes,yes,yes,no
|
49 |
-
37,7,no,no,yes,yes,no,yes,no
|
50 |
-
37,7,no,no,yes,yes,no,yes,no
|
51 |
-
37,7,no,yes,no,no,no,no,no
|
52 |
-
37,7,no,no,yes,no,no,yes,no
|
53 |
-
37,8,no,yes,no,no,no,no,no
|
54 |
-
37,8,no,no,yes,yes,yes,yes,no
|
55 |
-
37,8,no,no,yes,no,no,yes,no
|
56 |
-
37,9,no,no,yes,yes,no,yes,no
|
57 |
-
37,9,no,no,yes,yes,no,yes,no
|
58 |
-
37,9,no,yes,no,no,no,no,no
|
59 |
-
37,9,no,no,yes,yes,yes,yes,no
|
60 |
-
37,9,no,no,yes,no,no,yes,no
|
61 |
-
38,0,no,yes,yes,no,yes,no,yes
|
62 |
-
38,0,no,yes,yes,no,yes,no,yes
|
63 |
-
38,1,no,yes,yes,no,yes,no,yes
|
64 |
-
38,3,no,yes,yes,no,yes,no,yes
|
65 |
-
38,5,no,yes,yes,no,yes,no,yes
|
66 |
-
38,7,no,yes,yes,no,yes,no,yes
|
67 |
-
38,9,no,yes,yes,no,yes,no,yes
|
68 |
-
39,0,no,yes,yes,no,yes,no,yes
|
69 |
-
39,4,no,yes,yes,no,yes,no,yes
|
70 |
-
39,7,no,yes,yes,no,yes,no,yes
|
71 |
-
40,0,yes,yes,yes,yes,yes,yes,yes
|
72 |
-
40,0,yes,yes,yes,yes,yes,yes,yes
|
73 |
-
40,0,yes,yes,yes,yes,no,yes,yes
|
74 |
-
40,0,no,no,no,no,no,no,no
|
75 |
-
40,0,no,no,no,no,no,no,no
|
76 |
-
40,0,yes,yes,no,yes,no,no,yes
|
77 |
-
40,0,yes,yes,no,yes,no,no,yes
|
78 |
-
40,0,no,yes,yes,no,yes,no,yes
|
79 |
-
40,1,yes,yes,yes,yes,no,yes,yes
|
80 |
-
40,2,yes,yes,yes,yes,yes,yes,yes
|
81 |
-
40,2,no,no,no,no,no,no,no
|
82 |
-
40,2,yes,yes,no,yes,no,no,yes
|
83 |
-
40,3,no,yes,yes,no,yes,no,yes
|
84 |
-
40,4,yes,yes,yes,yes,yes,yes,yes
|
85 |
-
40,4,yes,yes,yes,yes,no,yes,yes
|
86 |
-
40,4,yes,yes,yes,yes,no,yes,yes
|
87 |
-
40,4,no,no,no,no,no,no,no
|
88 |
-
40,4,yes,yes,no,yes,no,no,yes
|
89 |
-
40,5,yes,yes,yes,yes,no,yes,yes
|
90 |
-
40,6,yes,yes,yes,yes,yes,yes,yes
|
91 |
-
40,6,no,no,no,no,no,no,no
|
92 |
-
40,6,yes,yes,no,yes,no,no,yes
|
93 |
-
40,7,yes,yes,yes,yes,yes,yes,yes
|
94 |
-
40,7,yes,yes,yes,yes,no,yes,yes
|
95 |
-
40,7,no,no,no,no,no,no,no
|
96 |
-
40,7,yes,yes,no,yes,no,no,yes
|
97 |
-
40,7,no,yes,yes,no,yes,no,yes
|
98 |
-
40,8,no,yes,yes,no,yes,no,yes
|
99 |
-
40,9,yes,yes,yes,yes,no,yes,yes
|
100 |
-
40,9,yes,yes,yes,yes,no,yes,yes
|
101 |
-
40,9,no,yes,yes,no,yes,no,yes
|
102 |
-
41,0,yes,yes,yes,yes,yes,yes,yes
|
103 |
-
41,0,no,no,no,no,no,no,no
|
104 |
-
41,0,yes,yes,no,yes,no,no,yes
|
105 |
-
41,0,no,yes,yes,no,yes,no,yes
|
106 |
-
41,1,yes,yes,yes,yes,yes,yes,yes
|
107 |
-
41,1,yes,yes,yes,yes,no,yes,yes
|
108 |
-
41,1,no,no,no,no,no,no,no
|
109 |
-
41,1,yes,yes,no,yes,no,no,yes
|
110 |
-
41,1,no,yes,yes,no,yes,no,yes
|
111 |
-
41,2,yes,yes,yes,yes,yes,yes,yes
|
112 |
-
41,2,no,no,no,no,no,no,no
|
113 |
-
41,2,yes,yes,no,yes,no,no,yes
|
114 |
-
41,2,no,yes,yes,no,yes,no,yes
|
115 |
-
41,3,yes,yes,yes,yes,no,yes,yes
|
116 |
-
41,4,no,yes,yes,no,yes,no,yes
|
117 |
-
41,5,no,no,no,no,no,no,no
|
118 |
-
41,5,yes,yes,no,yes,no,no,yes
|
119 |
-
41,5,no,yes,yes,no,yes,no,yes
|
120 |
-
41,5,no,yes,yes,no,yes,no,yes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
diagnosis.data
DELETED
Binary file (7.28 kB)
|
|
inflammation/acute_inflammation-train.parquet
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9eb14cc8c4b46e1eb94825ef7633d6552571222ed8d9cd8b81cddf3bd9db402a
|
3 |
+
size 4689
|