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

This commit is contained in:
2024-11-03 12:45:51 +08:00
parent 94437460dd
commit d9d35afd7f
+1 -4
View File
@@ -1,4 +1,4 @@
# function.py import os
import numpy as np import numpy as np
""" """
@@ -17,14 +17,12 @@ import numpy as np
- numpy: 2.1.1 - numpy: 2.1.1
""" """
""" """
请在这里填写学号和姓名,不填写即成绩无效。 请在这里填写学号和姓名,不填写即成绩无效。
""" """
id = "202210423120" id = "202210423120"
name = "袁焜" name = "袁焜"
# 这里写自己的代码实现 # 这里写自己的代码实现
import numpy as np import numpy as np
from sklearn.preprocessing import MinMaxScaler from sklearn.preprocessing import MinMaxScaler
@@ -141,7 +139,6 @@ if __name__ == "__main__":
# 测试模型 # 测试模型
final_test_accuracy = accuracy(X_test, y_test, final_weights) final_test_accuracy = accuracy(X_test, y_test, final_weights)
print(f"最终测试集的准确率: {final_test_accuracy:.4f}") print(f"最终测试集的准确率: {final_test_accuracy:.4f}")
# 加载测试集 # 加载测试集
X_test, y_test = load_data("./data/horse-colic.test") X_test, y_test = load_data("./data/horse-colic.test")