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

This commit is contained in:
2024-11-03 19:54:16 +08:00
parent b51132b8fd
commit 481be08233
+1
View File
@@ -65,6 +65,7 @@ def predict_logreg(inX, weights, bias):
Returns: Returns:
- int: 预测的分类标签。 - int: 预测的分类标签。
""" """
linear_model = np.dot(inX, weights) + bias linear_model = np.dot(inX, weights) + bias
y_pred = sigmoid(linear_model) y_pred = sigmoid(linear_model)
return 1 if y_pred >= 0.5 else 0 return 1 if y_pred >= 0.5 else 0