diff --git a/function.py b/function.py index 048eb99..606ca90 100644 --- a/function.py +++ b/function.py @@ -65,6 +65,7 @@ def predict_logreg(inX, weights, bias): Returns: - int: 预测的分类标签。 """ + linear_model = np.dot(inX, weights) + bias y_pred = sigmoid(linear_model) return 1 if y_pred >= 0.5 else 0