mstz commited on
Commit
e924549
·
1 Parent(s): 3d409e0

Upload student_performance.py

Browse files
Files changed (1) hide show
  1. student_performance.py +3 -3
student_performance.py CHANGED
@@ -148,13 +148,13 @@ class StudentPerformance(datasets.GeneratorBasedBuilder):
148
  data.loc[:, feature] = data[feature].apply(encoding_function)
149
 
150
  if config == "math":
151
- data = data.rename(columns={"math_score", "has_passed_math_exam"})
152
  return data[list(features_types_per_config["math"].keys())]
153
  elif config == "reading":
154
- data = data.rename(columns={"reading_score", "has_passed_reading_exam"})
155
  return data[list(features_types_per_config["reading"].keys())]
156
  elif config == "writing":
157
- data = data.rename(columns={"writing_score", "has_passed_writing_exam"})
158
  return data[list(features_types_per_config["writing"].keys())]
159
  else:
160
  raise ValueError(f"Unknown config: {config}")
 
148
  data.loc[:, feature] = data[feature].apply(encoding_function)
149
 
150
  if config == "math":
151
+ data = data.rename(columns={"math_score": "has_passed_math_exam"})
152
  return data[list(features_types_per_config["math"].keys())]
153
  elif config == "reading":
154
+ data = data.rename(columns={"reading_score": "has_passed_reading_exam"})
155
  return data[list(features_types_per_config["reading"].keys())]
156
  elif config == "writing":
157
+ data = data.rename(columns={"writing_score": "has_passed_writing_exam"})
158
  return data[list(features_types_per_config["writing"].keys())]
159
  else:
160
  raise ValueError(f"Unknown config: {config}")