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

This commit is contained in:
2024-10-31 15:22:22 +08:00
parent 186b3d5327
commit fbce23f64e
+5 -1
View File
@@ -107,4 +107,8 @@ if __name__ == "__main__":
X_test, y_test = load_data("./data/horse-colic.test")
# 训练对率回归模型
weights = train_logreg(
weights = train_logreg(X_train, y_train, learning_rate=0.0005, iterations=3000, batch_size=32, lambda_=0.05)
# 测试单个数据
y_pred = predict_logreg(X_test[11], weights)
print(f"预测结果: {y_pred}, 实际结果: {y_test[11]}")