mstz commited on
Commit
f6894ce
·
1 Parent(s): bab237a

Update liver.py

Browse files
Files changed (1) hide show
  1. liver.py +2 -3
liver.py CHANGED
@@ -27,7 +27,7 @@ urls_per_split = {
27
  }
28
  features_types_per_config = {
29
  "liver": {
30
- "age": datasets.Value("int8"),
31
  "is_male": datasets.Value("bool"),
32
  "total_bilirubin": datasets.Value("float64"),
33
  "direct_ribilubin": datasets.Value("float64"),
@@ -73,9 +73,8 @@ class ILPD(datasets.GeneratorBasedBuilder):
73
  def _generate_examples(self, filepath: str):
74
  data = pandas.read_csv(filepath).infer_objects()
75
  data[["is_male"]].applymap(bool)
76
- data[["class"]].applymap(lambda x: x - 1)
77
  data = data.astype({"is_male": "bool"})
78
- print(data.dtypes)
79
 
80
  for row_id, row in data.iterrows():
81
  data_row = dict(row)
 
27
  }
28
  features_types_per_config = {
29
  "liver": {
30
+ "age": datasets.Value("int64"),
31
  "is_male": datasets.Value("bool"),
32
  "total_bilirubin": datasets.Value("float64"),
33
  "direct_ribilubin": datasets.Value("float64"),
 
73
  def _generate_examples(self, filepath: str):
74
  data = pandas.read_csv(filepath).infer_objects()
75
  data[["is_male"]].applymap(bool)
76
+ data.loc[:, "class"] = data["class"].apply(lambda x: x - 1)
77
  data = data.astype({"is_male": "bool"})
 
78
 
79
  for row_id, row in data.iterrows():
80
  data_row = dict(row)