From 5a394273b41c5f400cde7ea4af44b63666c9a425 Mon Sep 17 00:00:00 2001 From: Xionghaoran <719929980@qq.com> Date: Thu, 31 Oct 2024 15:42:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20function.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- function.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/function.py b/function.py index 2b26b17..c1cb599 100644 --- a/function.py +++ b/function.py @@ -149,4 +149,5 @@ if __name__ == "__main__": weights, selector = train_logreg(X_train, y_train, learning_rate=0.0001, iterations=5000, batch_size=32, lambda_=0.1, degree=2) # 测试单个数据 - y_pred = predict_logreg(X_test[11], weights + y_pred = predict_logreg(X_test[11], weights, selector=selector, degree=2) + print(f"预测结果: {y_pred}, 实际结果: {y_test[11]}")