mstz commited on
Commit
d3e681a
·
1 Parent(s): 69d4f0c

Upload hypo.py

Browse files
Files changed (1) hide show
  1. hypo.py +3 -4
hypo.py CHANGED
@@ -134,7 +134,6 @@ class Hypo(datasets.GeneratorBasedBuilder):
134
  yield row_id, data_row
135
 
136
  def preprocess(self, data: pandas.DataFrame) -> pandas.DataFrame:
137
- print(data.columns)
138
  data.drop("id", axis="columns", inplace=True)
139
  data.drop("TBG", axis="columns", inplace=True)
140
 
@@ -151,13 +150,13 @@ class Hypo(datasets.GeneratorBasedBuilder):
151
 
152
  for feature in _ENCODING_DICS:
153
  encoding_function = partial(self.encode, feature)
154
- print(feature)
155
- print(data[feature].unique())
156
  data[feature] = data[feature].apply(encoding_function)
157
 
158
  if self.config.name == "has_hypo":
159
  data["class"] = data["class"].apply(lambda x: 0 if x == 0 else 1)
160
-
 
 
161
  return data[list(features_types_per_config[self.config.name].keys())]
162
 
163
  def encode(self, feature, value):
 
134
  yield row_id, data_row
135
 
136
  def preprocess(self, data: pandas.DataFrame) -> pandas.DataFrame:
 
137
  data.drop("id", axis="columns", inplace=True)
138
  data.drop("TBG", axis="columns", inplace=True)
139
 
 
150
 
151
  for feature in _ENCODING_DICS:
152
  encoding_function = partial(self.encode, feature)
 
 
153
  data[feature] = data[feature].apply(encoding_function)
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([f for f in data.columns if "?" in data[f].unique()])
159
+
160
  return data[list(features_types_per_config[self.config.name].keys())]
161
 
162
  def encode(self, feature, value):