generated from LufsX/Experiment-LogReg
This commit is contained in:
+1
-4
@@ -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")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user