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

This commit is contained in:
2024-11-05 11:08:15 +08:00
parent 173c40cedd
commit f699d7ea09
+1 -2
View File
@@ -86,9 +86,8 @@ def load_data(filepath):
X = data[:, :-1] # 假设最后一列为标签 X = data[:, :-1] # 假设最后一列为标签
y = data[:, -1] # 最后一列为标签 y = data[:, -1] # 最后一列为标签
# 确保 y 是二进制的,1表示死亡,0表示存活
y = np.where(y == 1, 1, 0) # 处理标签,确保其为0或1 y = np.where(y == 1, 1, 0) # 处理标签,确保其为0或1
return X, y return X, y
if __name__ == "__main__": if __name__ == "__main__":