Download Lecture notes - Columbia Applied Data Science

Transcript
ii
II
CONTENTS
The Classic Regression Models
23
4 Notation
24
4.1 Notation for Structured Data . . . . . . . . . . . . . . . . . . 24
5 Linear Regression
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Coefficient Estimation: Bayesian Formulation . . . . . .
5.2.1 Generic setup . . . . . . . . . . . . . . . . . . . .
5.2.2 Ideal Gaussian World . . . . . . . . . . . . . . .
5.3 Coefficient Estimation: Optimization Formulation . . .
5.3.1 The least squares problem and the singular value
composition . . . . . . . . . . . . . . . . . . . . .
5.3.2 Overfitting examples . . . . . . . . . . . . . . . .
5.3.3 L2 regularization . . . . . . . . . . . . . . . . . .
5.3.4 Choosing the regularization parameter . . . . . .
5.3.5 Numerical techniques . . . . . . . . . . . . . . .
5.4 Variable Scaling and Transformations . . . . . . . . . .
5.4.1 Simple variable scaling . . . . . . . . . . . . . . .
5.4.2 Linear transformations of variables . . . . . . . .
5.4.3 Nonlinear transformations and segmentation . .
5.5 Error Metrics . . . . . . . . . . . . . . . . . . . . . . . .
5.6 End Notes . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .
. . .
. . .
. . .
. . .
de. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
6 Logistic Regression
6.1 Formulation . . . . . . . . . . . . . . . . .
6.1.1 Presenter’s viewpoint . . . . . . .
6.1.2 Classical viewpoint . . . . . . . . .
6.1.3 Data generating viewpoint . . . . .
6.2 Determining the regression coefficient w .
6.3 Multinomial logistic regression . . . . . .
6.4 Logistic regression for classification . . . .
6.5 L1 regularization . . . . . . . . . . . . . .
6.6 Numerical solution . . . . . . . . . . . . .
6.6.1 Gradient descent . . . . . . . . . .
6.6.2 Newton’s method . . . . . . . . . .
6.6.3 Solving the L1 regularized problem
6.6.4 Common numerical issues . . . . .
6.7 Model evaluation . . . . . . . . . . . . . .
6.8 End Notes . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
26
26
29
29
30
33
35
39
43
44
46
47
48
51
52
53
54
55
55
55
56
57
58
61
62
64
66
67
68
70
70
72
73