From 7a2ee1f80f36019044dbdd382262b0cc5c84de0d Mon Sep 17 00:00:00 2001 From: mogu-king <1547976000@qq.com> Date: Sun, 3 Nov 2024 04:18:51 +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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/function.py b/function.py index bf5d1f9..a810ea0 100644 --- a/function.py +++ b/function.py @@ -45,12 +45,9 @@ def load_data(filepath): X = data[:, :-1] y = data[:, -1] - # 标准化特征数据 - X = (X - np.mean(X, axis=0)) / np.std(X, axis=0) - return X, y # 这里实现对率回归训练函数 -def train_logreg(X, y, learning_rate=0.001, num_iterations=5000, regularization_strength=0.001): +def train_logreg(X, y, learning_rate=0.01, num_iterations=1000, regularization_strength=0): """ 对率回归训练函数。