mstz commited on
Commit
7a51ffd
1 Parent(s): 03a62ca

Upload anneal.py

Browse files
Files changed (1) hide show
  1. anneal.py +4 -1
anneal.py CHANGED
@@ -148,7 +148,10 @@ 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.loc[:, "formability"] = data.formability.apply(lambda x: int(x) if x not in ("-", "?") else 0)
 
 
 
152
  data.loc[:, "enamelability"] = data.enamelability.apply(lambda x: int(x) if x != "-" else 0)
153
  data.loc[:, "non_ageing"] = data.formability.apply(lambda x: True if x == "-" else False)
154
  data.loc[:, "bc"] = data.bc.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 != "-" 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)