generated from LufsX/Experiment-LogReg
This commit is contained in:
+1
-1
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user