更新 function.py
Gitea Actions Test / Challenge-Actions (push) Successful in 41s

This commit is contained in:
cy
2024-12-03 09:35:31 +08:00
parent dbbb859f4e
commit 843c24a82e
+1 -1
View File
@@ -50,7 +50,7 @@ def load_data(filepath):
fields = [0 if f == '?' else float(f) for f in fields] fields = [0 if f == '?' else float(f) for f in fields]
# 标签是倒数第6列 # 标签是倒数第6列
label = int(fields[-6]) label = int(fields[-6])
# 特征为其他列(不包含倒数第6列标签) # 特征为其他列(不包含倒数第6列标签)
features = np.array(fields[: -6] + fields[-5:], dtype=float) features = np.array(fields[: -6] + fields[-5:], dtype=float)
# 标签映射:将 1->0, 2->1, 3->2 # 标签映射:将 1->0, 2->1, 3->2
if label == 1: if label == 1: