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