Datasets:
Update breast.py
Browse files
breast.py
CHANGED
@@ -83,7 +83,7 @@ class Breast(datasets.GeneratorBasedBuilder):
|
|
83 |
DEFAULT_CONFIG = "cancer"
|
84 |
BUILDER_CONFIGS = [
|
85 |
BreastConfig(name="cancer",
|
86 |
-
description="
|
87 |
]
|
88 |
|
89 |
|
@@ -118,13 +118,10 @@ class Breast(datasets.GeneratorBasedBuilder):
|
|
118 |
data.drop("id", axis="columns", inplace=True)
|
119 |
|
120 |
data = data[data.bare_nuclei != "?"]
|
121 |
-
for
|
122 |
-
data.loc[:, c] = data[c].astype(int)
|
123 |
|
124 |
data.columns = _BASE_FEATURE_NAMES
|
125 |
data.loc[:, "is_cancer"] = data.is_cancer.apply(lambda x: 0 if x == 2 else 1)
|
126 |
|
127 |
-
|
128 |
-
|
129 |
-
else:
|
130 |
-
raise ValueError(f"Unknown config: {config}")
|
|
|
83 |
DEFAULT_CONFIG = "cancer"
|
84 |
BUILDER_CONFIGS = [
|
85 |
BreastConfig(name="cancer",
|
86 |
+
description="Breast cancer binary classification."),
|
87 |
]
|
88 |
|
89 |
|
|
|
118 |
data.drop("id", axis="columns", inplace=True)
|
119 |
|
120 |
data = data[data.bare_nuclei != "?"]
|
121 |
+
data = data.astype({f: int for f in data.columns})
|
|
|
122 |
|
123 |
data.columns = _BASE_FEATURE_NAMES
|
124 |
data.loc[:, "is_cancer"] = data.is_cancer.apply(lambda x: 0 if x == 2 else 1)
|
125 |
|
126 |
+
|
127 |
+
return data
|
|
|
|