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

This commit is contained in:
2024-10-31 16:50:31 +08:00
parent 7cba228d95
commit 999b5e85f8
+1 -1
View File
@@ -67,7 +67,7 @@ def predict_logreg(inX, weights):
Returns: Returns:
- int: 预测的分类标签。 - int: 预测的分类标签。
""" """
z = np.dot(inX, weights) z = np.dot(inX, weights)
prediction_prob = 1 / (1 + np.exp(-z)) prediction_prob = 1 / (1 + np.exp(-z))
return 1 if prediction_prob >= 0.5 else 0 return 1 if prediction_prob >= 0.5 else 0