Datasets:
Update heart_failure.py
Browse files- heart_failure.py +1 -0
heart_failure.py
CHANGED
@@ -95,6 +95,7 @@ class HeartFailure(datasets.GeneratorBasedBuilder):
|
|
95 |
|
96 |
def preprocess(self, data: pandas.DataFrame, config: str = "death") -> pandas.DataFrame:
|
97 |
data.columns = _BASE_FEATURE_NAMES
|
|
|
98 |
data = data.astype({"has_anaemia": "bool", "has_diabetes": "bool", "has_high_blood_pressure": "bool", "is_male": "bool",
|
99 |
"is_smoker": "bool"})
|
100 |
|
|
|
95 |
|
96 |
def preprocess(self, data: pandas.DataFrame, config: str = "death") -> pandas.DataFrame:
|
97 |
data.columns = _BASE_FEATURE_NAMES
|
98 |
+
data = data.rename(columns={"sex": "is_male"})
|
99 |
data = data.astype({"has_anaemia": "bool", "has_diabetes": "bool", "has_high_blood_pressure": "bool", "is_male": "bool",
|
100 |
"is_smoker": "bool"})
|
101 |
|