mstz commited on
Commit
c882093
1 Parent(s): 88028db

Upload anneal.py

Browse files
Files changed (1) hide show
  1. anneal.py +4 -4
anneal.py CHANGED
@@ -148,11 +148,11 @@ class Anneal(datasets.GeneratorBasedBuilder):
148
 
149
  def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
150
  data.columns = _BASE_FEATURE_NAMES
151
- data = data[data.formability != "?"]
152
- data = data[data.enamelability != "?"]
153
 
154
- data.loc[:, "formability"] = data.formability.apply(lambda x: int(x) if x != "-" else 0)
155
- data.loc[:, "enamelability"] = data.enamelability.apply(lambda x: int(x) if x != "-" else 0)
156
  data.loc[:, "non_ageing"] = data.formability.apply(lambda x: True if x == "-" else False)
157
  data.loc[:, "bc"] = data.bc.apply(lambda x: True if x == "Y" else False)
158
  data.loc[:, "bf"] = data.bf.apply(lambda x: True if x == "Y" else False)
 
148
 
149
  def preprocess(self, data: pandas.DataFrame, config: str = DEFAULT_CONFIG) -> pandas.DataFrame:
150
  data.columns = _BASE_FEATURE_NAMES
151
+ # data = data[data.formability != "?"]
152
+ # data = data[data.enamelability != "?"]
153
 
154
+ data.loc[:, "formability"] = data.formability.apply(lambda x: int(x) if x not in ("?", "-") else 0)
155
+ data.loc[:, "enamelability"] = data.enamelability.apply(lambda x: int(x) if x not in ("?", "-") else 0)
156
  data.loc[:, "non_ageing"] = data.formability.apply(lambda x: True if x == "-" else False)
157
  data.loc[:, "bc"] = data.bc.apply(lambda x: True if x == "Y" else False)
158
  data.loc[:, "bf"] = data.bf.apply(lambda x: True if x == "Y" else False)