Datasets:
Upload heloc.py
Browse files
heloc.py
CHANGED
@@ -146,10 +146,10 @@ class Heloc(datasets.GeneratorBasedBuilder):
|
|
146 |
yield row_id, data_row
|
147 |
|
148 |
def preprocess(self, data: pandas.DataFrame, config: str = "cancer") -> pandas.DataFrame:
|
149 |
-
print(list(features_types_per_config["risk"].keys()))
|
150 |
-
print(data.columns)
|
151 |
data = data[list(features_types_per_config["risk"].keys())]
|
152 |
|
|
|
|
|
153 |
if config == "risk":
|
154 |
return data
|
155 |
else:
|
|
|
146 |
yield row_id, data_row
|
147 |
|
148 |
def preprocess(self, data: pandas.DataFrame, config: str = "cancer") -> pandas.DataFrame:
|
|
|
|
|
149 |
data = data[list(features_types_per_config["risk"].keys())]
|
150 |
|
151 |
+
data.loc[:, "is_at_risk"] = data.is_at_risk.apply(lambda x: 1 if x == "Bad" else 0)
|
152 |
+
|
153 |
if config == "risk":
|
154 |
return data
|
155 |
else:
|