Datasets:
Upload hypo.py
Browse files
hypo.py
CHANGED
@@ -58,7 +58,8 @@ features_types_per_config = {
|
|
58 |
"FTI": datasets.Value("float64"),
|
59 |
"TBG_measured": datasets.Value("string"),
|
60 |
"referral_source": datasets.Value("string"),
|
61 |
-
"class": datasets.ClassLabel(num_classes=4,
|
|
|
62 |
},
|
63 |
"has_hypo": {
|
64 |
"age": datasets.Value("int8"),
|
@@ -154,8 +155,10 @@ class Hypo(datasets.GeneratorBasedBuilder):
|
|
154 |
|
155 |
if self.config.name == "has_hypo":
|
156 |
data["class"] = data["class"].apply(lambda x: 0 if x == 0 else 1)
|
|
|
157 |
|
158 |
-
print(
|
|
|
159 |
|
160 |
return data[list(features_types_per_config[self.config.name].keys())]
|
161 |
|
|
|
58 |
"FTI": datasets.Value("float64"),
|
59 |
"TBG_measured": datasets.Value("string"),
|
60 |
"referral_source": datasets.Value("string"),
|
61 |
+
"class": datasets.ClassLabel(num_classes=4,
|
62 |
+
names=("negative", "compensated hypothyroid", "secondary hypothyroid", "primary hypothyroid"))
|
63 |
},
|
64 |
"has_hypo": {
|
65 |
"age": datasets.Value("int8"),
|
|
|
155 |
|
156 |
if self.config.name == "has_hypo":
|
157 |
data["class"] = data["class"].apply(lambda x: 0 if x == 0 else 1)
|
158 |
+
print("has hypo\n\n\n")
|
159 |
|
160 |
+
print("classes")
|
161 |
+
print(data["class"].unique())
|
162 |
|
163 |
return data[list(features_types_per_config[self.config.name].keys())]
|
164 |
|