Regression 1
Assumption: Linear Model
2
Assumption: Linear Model
3
Linear Regression
4
Linear Regression as Optimization
5
Re-cast Problem as Least Squares
6
Optimization
7
Optimization: Note
8
the same principle in a higher dimension
Revisit: Least-Square Solution
9
1. Solve using Linear Algebra
10
1. Solve using Linear Algebra
11
2. Solve using Gradient Descent
12
3. Solve using CVXPY Optimization
13
3. Solve using CVXPY Optimization
14
15
Regression with Outliers
16
Regression with Outliers
17
18
Think About What Makes Different
19
Scikit-Learn
20
Scikit-Learn
21
Scikit-Learn: Regression
22
Scikit-Learn: Regression
23
Multivariate Linear Regression
24
Multivariate Linear Regression
25
Multivariate Linear Regression
26
Nonlinear Regression (Actually Linear Regression)
27
Nonlinear Regression (Actually Linear Regression)
28
Polynomial Regression
29
Polynomial Regression
30
Summary: Linear Regression
31
Regression 2
Linear Regression: Advanced
33
Overfitting: Start with Linear Regression
34
Recap: Nonlinear Regression
35
Nonlinear Regression
36
10 input points with degree 9 (or 10)
Polynomial Fitting with Different Degrees
37
Low error on input data points,
but high error nearby
Loss
38
Minimizing loss in training data is
often not the best
Low error on input data points,
but high error nearby
Issue with Rich Representation
39
Function Approximation:�Linear Basis Function Model
40
Function Approximation
41
Recap: Nonlinear Regression
42
Different perspective:
- Approximate a target function as a linear combination of basis
Construct Explicit Feature Vectors
43
Polynomial Basis
1) Polynomial functions
44
RBF Basis
45
Linear Regression with RBF
46
Regularization
47
Issue with Rich Representation
48
Generalization Error
49
Representational Difficulties
50
With Less Basis Functions: Fewer RBF Centers
51
With Less Basis Functions: Fewer RBF Centers
52
Representational Difficulties
53
Regularization (Shrinkage Methods)
54
Regularization (Shrinkage Methods)
55
RBF: Start from Rich Representation
56
RBF with Regularization
57
58
59
RBF with LASSO
60
61
LASSO
Ridge
62
LASSO
Sparsity for Feature Selection using Lasso
63
Regression with Selected Features
64
LASSO vs. Ridge
65
LASSO vs. Ridge
66
L2 Regularizers: Simple Example
67
L1 Regularizers: Simple Example
68
L1 Regularizers: Simple Example
69
L1 Regularizers: Simple Example
70
L1 Regularizers: Simple Example
71
L1 Regularizers: Simple Example
72
L1 Regularizers: Simple Example
73
L1 Regularizers: Simple Example
74
L1 Regularizers: Simple Example
75
L1 Regularizers: Simple Example
76
Evaluation
77
Regression 3
Linear Regression Examples
79
De-noising Signal
80
Transform it to an Optimization Problem
81
Source:
Transform it to an Optimization Problem
82
Least-Square Problems
83
Coded in Python
84
85
CVXPY Implementation
86
87
88
89
90
Signal with Sharp Transition + Noise
91
Chapter 6.3 from Boyd & Vandenberghe's book "Convex Optimization”
92
93
94
Total Variation Image
95
Idea comes from http://www2.compute.dtu.dk/~pcha/mxTV/
Total Variation Image
96
Idea comes from http://www2.compute.dtu.dk/~pcha/mxTV/