Skip to content

Commit fff19ad

Browse files
0.14.14
diabetes
1 parent d56eaca commit fff19ad

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77

88
[project]
99
name = "spotpython"
10-
version = "0.14.13"
10+
version = "0.14.14"
1111
authors = [
1212
{ name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" }
1313
]

src/spotPython/data/diabetes.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ class Diabetes(Dataset):
1010
and six blood serum measurements were obtained for each of n = 442 diabetes patients,
1111
as well as the response of interest,
1212
a quantitative measure of disease progression one year after baseline.
13+
Number of Instances: 442
14+
Number of Attributes:
15+
First 10 columns are numeric predictive values.
16+
Target: Column 11 is a quantitative measure of disease progression one year after baseline.
17+
Attribute Information:
18+
* age age in years
19+
* sex
20+
* bmi body mass index
21+
* bp average blood pressure
22+
* s1 tc, total serum cholesterol
23+
* s2 ldl, low-density lipoproteins
24+
* s3 hdl, high-density lipoproteins
25+
* s4 tch, total cholesterol / HDL
26+
* s5 ltg, possibly log of serum triglycerides level
27+
* s6 glu, blood sugar level
1328
1429
Args:
1530
feature_type (torch.dtype): The data type of the features. Defaults to torch.float.
@@ -45,6 +60,7 @@ def __init__(
4560
self.feature_type = feature_type
4661
self.target_type = target_type
4762
self.train = train
63+
self.names = self.get_names()
4864
self.data, self.targets = self._load_data()
4965

5066
def _load_data(self) -> tuple:
@@ -122,3 +138,18 @@ def extra_repr(self) -> str:
122138
"""
123139
split = "Train" if self.train else "Test"
124140
return f"Split: {split}"
141+
142+
def get_names(self) -> list:
143+
"""
144+
Returns the names of the features.
145+
146+
Returns:
147+
list: A list containing the names of the features.
148+
149+
Examples:
150+
>>> from spotPython.data.diabetes import Diabetes
151+
dataset = Diabetes()
152+
print(dataset.get_names())
153+
["age", "sex", "bmi", "bp", "tc", "ldl", "hdl", "tch", "ltg", "glu"]
154+
"""
155+
return ["age", "sex", "bmi", "bp", "tc", "ldl", "hdl", "tch", "ltg", "glu"]

0 commit comments

Comments
 (0)