更新 function.py

This commit is contained in:
Wyy
2024-10-24 16:37:55 +08:00
parent e8e537be9a
commit e4bf84d286
+2 -1
View File
@@ -5,7 +5,7 @@ import numpy as np
""" """
id = "202210423224" id = "202210423224"
name = "吴杨洋" name = "吴杨洋"
def sigmoid(z): def sigmoid(z):
""" """
Sigmoid 激活函数。 Sigmoid 激活函数。
@@ -34,6 +34,7 @@ def train_logreg(X, y, learning_rate=0.01, iterations=1000):
weights -= learning_rate * gradient weights -= learning_rate * gradient
return weights return weights
def predict_logreg(inX, weights): def predict_logreg(inX, weights):
""" """
对率回归预测函数。 对率回归预测函数。