@@ -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