Datasets:
Upload breast.py
Browse files
breast.py
CHANGED
@@ -122,7 +122,10 @@ class Breast(datasets.GeneratorBasedBuilder):
|
|
122 |
def preprocess(self, data: pandas.DataFrame, config: str = "cancer") -> pandas.DataFrame:
|
123 |
data.drop("id", axis="columns", inplace=True)
|
124 |
|
125 |
-
data
|
|
|
|
|
|
|
126 |
|
127 |
data.columns = _BASE_FEATURE_NAMES
|
128 |
data.loc[:, "is_cancer"] = data.is_cancer.apply(lambda x: 0 if x == 2 else 1)
|
|
|
122 |
def preprocess(self, data: pandas.DataFrame, config: str = "cancer") -> pandas.DataFrame:
|
123 |
data.drop("id", axis="columns", inplace=True)
|
124 |
|
125 |
+
print(data.dtypes)
|
126 |
+
data = data[data.bare_nuclei != "?"]
|
127 |
+
for c in data.columns:
|
128 |
+
data.loc[:, c] = data[c].astype(int)
|
129 |
|
130 |
data.columns = _BASE_FEATURE_NAMES
|
131 |
data.loc[:, "is_cancer"] = data.is_cancer.apply(lambda x: 0 if x == 2 else 1)
|