From 1afe2c29c717974914ac159c04a2b21364d9f4c8 Mon Sep 17 00:00:00 2001 From: dong <2938690875@qq.com> Date: Thu, 31 Oct 2024 17:11:12 +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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/function.py b/function.py index 0bfeecc..b9f46c8 100644 --- a/function.py +++ b/function.py @@ -100,9 +100,11 @@ if __name__ == "__main__": # 以下代码可用于测试,可自行随意修改 # 加载训练集 X_train, y_train = load_data("./data/horse-colic.data") + X_train = preprocess_data(X_train) # 加载测试集 X_test, y_test = load_data("./data/horse-colic.test") + X_test = preprocess_data(X_test) # 训练对率回归模型 weights = train_logreg(X_train, y_train, learning_rate=0.01, iterations=1000,lambda_reg=0.01)