generated from LufsX/Challenge-SVM
This commit is contained in:
+1
-1
@@ -50,7 +50,7 @@ def load_data(filepath):
|
||||
fields = [0 if f == '?' else float(f) for f in fields]
|
||||
# 标签是倒数第6列
|
||||
label = int(fields[-6])
|
||||
# 特征为其他列(不包含倒数第6列标签)
|
||||
# 特征为其他列(不包含倒数第6列标签)
|
||||
features = np.array(fields[: -6] + fields[-5:], dtype=float)
|
||||
# 标签映射:将 1->0, 2->1, 3->2
|
||||
if label == 1:
|
||||
|
||||
Reference in New Issue
Block a user