机器学习笔记 ---- Logistic Regression
Logistic Regression
1. Problems of Linear Regression When Applied to Classification Problem
1) h(x) may out of range
2) some unusual feature values lead to failure of classification
2. Logistic Regression Model
where is called Sigmoid Function / Logistic Function
3. Decision Boundary
y=1 → →
y=0 → →
decision boundary: → (may be nonlinear)
4. Cost Function
where
5.Iteration Formula
vectorized formula:
(identical to linear regression)
6. Some Optimization Algorithms
Conjugate Gradient / BFGS / L-BFGS
No need to pick α and faster, but more complex
7. Multiclass Classification: one-vs-all
Train for every individual i.
When predicting, using
8.Overfitting Problems
underfit — high bias — too few features
overfit — high variance — too many features —- fail to predict
2 solutions:
1) Reduce features
2) Regularization: Keep all features while reduce the values of some features
9. Regularization
adding to
Note that it does not contain !
: regularization parameter, making small
10. Regularized Linear Regression
(1) Linear Regression
Note that it does not contain !
for
which is also
for
(2) Normal Equation
where size of diag() is (n+1)*(n+1)