Datasets:
Upload anneal.py
Browse files
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
|
|
|
|
|
|
|
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)
|