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

This commit is contained in:
2024-11-03 04:18:51 +08:00
parent 681d30274b
commit 7a2ee1f80f
+1 -4
View File
@@ -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):
"""
对率回归训练函数。