mstz commited on
Commit
3a9740d
1 Parent(s): 904baa9

Upload breast.py

Browse files
Files changed (1) hide show
  1. breast.py +4 -1
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 = data[~data.bare_nuclei.isna()]
 
 
 
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)