Mar 2, 2026 1 min read en machine learning / cs229 / notes CS229 Machine Learning - Logistic Regression From regression to classification: logistic regression model, sigmoid function, and multi-class classification. Views: CS229 Machine Learning (4 posts) 1 CS229 Machine Learning - Introduction and Overview 2 CS229 Machine Learning - Linear Regression 3 CS229 Machine Learning - Logistic Regression 4 CS229 Machine Learning - Generalized Linear Models 我们接下来将视角转向分类问题,分类问题与回归问题类似,区别在于需要预测的目标变量只能取有限的离散值。 通常,000被称为负类,111被称为正类,有时也用符号”-“和”+表示” 逻辑回归# 首先,由于yyy只能取{0,1}\{0,1\}{0,1}中的值,模型的输出hθ(x)h_{\theta}(x)hθ(x)取大于111或小于000的值是没有意义的。 我们将选择 hθ(x)=g(θTx)=11+e−θTxh_{\theta}(x) = g(\theta^Tx) = \frac{1}{1+e^{-\theta^Tx}}hθ(x)=g(θTx)=1+e−θTx1 其中 g(z)=11+e−zg(z) = \frac{1}{1 + e^{-z}}g(z)=1+e−z1 称为逻辑函数或S形函数。 多类别分类# 附录#