-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
2529 lines (2036 loc) · 72.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<title>Dimensionality Reduction</title>
<meta charset="utf-8">
<meta name="description" content="Dimensionality Reduction">
<meta name="author" content="Ping Jin ([email protected]) and Prof. Russell Greiner ([email protected])">
<meta name="generator" content="slidify" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<link rel="stylesheet" href="libraries/frameworks/io2012/css/default.css" media="all" >
<link rel="stylesheet" href="libraries/frameworks/io2012/phone.css"
media="only screen and (max-device-width: 480px)" >
<link rel="stylesheet" href="libraries/frameworks/io2012/css/slidify.css" >
<link rel="stylesheet" href="libraries/highlighters/highlight.js/css/tomorrow.css" />
<base target="_blank"> <!-- This amazingness opens all links in a new tab. -->
<script data-main="libraries/frameworks/io2012/js/slides"
src="libraries/frameworks/io2012/js/require-1.0.8.min.js">
</script>
<link rel="stylesheet" href = "assets/css/ribbons.css">
</head>
<body style="opacity: 0">
<slides class="layout-widescreen">
<!-- LOGO SLIDE -->
<!-- END LOGO SLIDE -->
<!-- TITLE SLIDE -->
<!-- Should I move this to a Local Layout File? -->
<slide class="title-slide segue nobackground">
<hgroup class="auto-fadein">
<h1>Dimensionality Reduction</h1>
<h2>CMPUT 466/551</h2>
<p>Ping Jin ([email protected]) and Prof. Russell Greiner ([email protected])<br/></p>
</hgroup>
</slide>
<!-- SLIDES -->
<slide class="" id="slide-1" style="background:;">
<hgroup>
<h2>Outline</h2>
</hgroup>
<article>
<ul>
<li><h3>Introduction to Dimensionality Reduction</h3></li>
<li><h3>Linear Regression and Least Squares (Review)</h3></li>
<li><h3>Subset Selection</h3></li>
<li><h3>Shrinkage Methods</h3></li>
<li><h3>Beyond LASSO</h3></li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-2" style="background:;">
<hgroup>
<h2>Part 1: Introduction to Dimensionality Reduction</h2>
</hgroup>
<article>
<ol>
<li><b>Introduction to Dimensionality Reduction</b>
<ul>
<li><b>General notations</b></li>
<li><b>Motivations</b></li>
<li><b>Feature selection and feature extraction</b></li>
<li><b>Feature Selection</b></li>
<li><b>Feature Extraction</b></li>
</ul></li>
<li>Linear Regression and Least Squares (Review)</li>
<li>Subset Selection</li>
<li>Shrinkage Methods</li>
<li>Beyond LASSO<br></li>
</ol>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-3" style="background:;">
<hgroup>
<h2>General Notations</h2>
</hgroup>
<article>
<h3>Dataset</h3>
<div class='left' style='float:left;width:50%'>
<ul>
<li>\(\mathbf{X}\): columnwise centered \(N \times p\) matrix
<ul>
<li>\(N:\) # samples, \(p:\) # features</li>
<li>An intercept vector \(\mathbf{1}\) is added to \(\mathbf{X}\), then \(\mathbf{X}\) is \(N \times (p+1)\) matrix</li>
</ul></li>
<li>\(\mathbf{y}\): \(N \times 1\) vector of labels(classification) or continous values(regression)</li>
</ul>
</div>
<div class='right' style='float:right;width:50%'>
<p><center><img src="assets/img/xy.png" alt="x" title="xy"></center></p>
</div>
<div style='float:left;width:100%;' class='centered'>
<h3>Basic Model</h3>
<ul>
<li>Linear Regression
<ul>
<li>Assumption: the regression function \(E(Y|X)\) is linear
\[f(X) = X^T\beta\]</li>
<li>\(\beta\): \((p+1) \times 1\) vector of coefficients</li>
</ul></li>
</ul>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-4" style="background:;">
<hgroup>
<h2>Motivations</h2>
</hgroup>
<article>
<ul>
<li>Dimensionality Reduction is about transforming data with high dimensionality into data of much lower dimensionality
<ul>
<li><b>Computational efficiency</b>: less dimensions require less computations</li>
<li><b>Accuracy</b>: lower risk of overfitting</li>
</ul></li>
</ul>
<div class='left' style='float:left;width:53%'>
<ul>
<li><b>Categories</b>
<ul>
<li>Feature Selection:<br>
<ul>
<li>chooses a subset of features from the original feature set</li>
</ul></li>
<li>Feature Extraction:
<ul>
<li>transforms the original features into new ones, linearly or non-linearly</li>
<li>e.g. PCA, ICA, etc.</li>
</ul></li>
</ul></li>
</ul>
</div>
<div class='right' style='float:right;width:47%'>
<p><br></p>
<p><center><img src="assets/img/fs.gif" alt="fs" title="fs"></center></p>
<p><center><img src="assets/img/fe.gif" alt="fe" title="fe"></center></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-5" style="background:;">
<hgroup>
<h2>Feature Selection and Feature Extraction</h2>
</hgroup>
<article>
<div class='left' style='float:left;width:50%'>
<h3>Feature Selection</h3>
<ul>
<li>Easier to interpret</li>
<li>Reduces cost: computation, budget, etc.</li>
</ul>
<p><br>
<br>
<br>
<center><img src="assets/img/fs2.gif" alt="fs2" title="fs2"></center></p>
</div>
<div class='right' style='float:right;width:50%'>
<h3>Feature Extraction</h3>
<ul>
<li>More flexible. Feature selection is a special case of linear feature extraction</li>
</ul>
<p><br>
<br>
<br></p>
<p><center><img src="assets/img/fe2.gif" alt="fe2" title="fe2"></center></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-6" style="background:;">
<hgroup>
<h2>Feature Selection and Feature Extraction</h2>
</hgroup>
<article>
<h3>Example 1: Prostate Cancer</h3>
<ul>
<li><b>Response</b>: level of prostate-specific antigen (lpsa). </li>
<li><b>Initial Feature Set</b>:
\[\{lcavol, lweight, age, lbph, svi, lcp, gleason, pgg45\}.\]</li>
<li><b>Task</b>:
<ul>
<li>predict \(lpsa\) from measurements of features</li>
</ul></li>
</ul>
<p>Feature selection</p>
<ul>
<li>Cost: Measuring features cost money</li>
<li>Interpretation: Doctors can see which features are important</li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-7" style="background:;">
<hgroup>
<h2>Feature Selection and Feature Extraction</h2>
</hgroup>
<article>
<h3>Example 2: classification with fMRI data</h3>
<ul>
<li><p>fMRI data are 4D images, with one dimension being time. </p></li>
<li><p>Each image is ~ \(50 \times 50 \times 50\)(spatial) \(\times 200\)(times) \(= 25M\) dimensions</p></li>
</ul>
<p>Feature extraction </p>
<ul>
<li>Individual voxel-times are not important </li>
<li>Cost is not correlated with #features</li>
<li>Feature extraction offers more flexibility in transforming features, which potentially results in better accuracy</li>
</ul>
<p><center><img src="assets/img/fMRI2.png" alt="fMRI2" title="fmri2"></center></p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-8" style="background:;">
<hgroup>
<h2>Feature Selection Methods</h2>
</hgroup>
<article>
<h3>Wrapper Methods</h3>
<ul>
<li>Search the space of feature subsets</li>
<li>Use the cross validation accuracy w.r.t. a specific classifier as the measure of utility for a candidate subset</li>
<li>e.g. see how it works for a feature set {1, 2, 3} in the figure below
<ul>
<li>\(1,2\), and \(3\) represent the \(1st\), \(2nd\) and \(3rd\) feature respectively</li>
</ul></li>
</ul>
<p><center><img src="assets/img/wrapper.png" alt="wrapper" title="wrapper"></center></p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-9" style="background:;">
<hgroup>
<h2>Feature Selection Methods</h2>
</hgroup>
<article>
<h3>Embedded Methods</h3>
<ul>
<li>exploit the structure of specific classes of learning models to guide the feature selection process</li>
<li>embedded as part of the model construction process
<ul>
<li>e.g. LASSO. </li>
</ul></li>
</ul>
<p><center><img src="assets/img/embedded.png" alt="embedded" title="embedded"></center></p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-10" style="background:;">
<hgroup>
<h2>Feature Selection Methods</h2>
</hgroup>
<article>
<h3>Filter Methods</h3>
<ul>
<li>use some general rules/criterions to measure the feature selection results independent of the classifiers</li>
<li>e.g. mutual information</li>
</ul>
<p><center><img src="assets/img/filter.png" alt="filter" title="filter"></center></p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-11" style="background:;">
<hgroup>
<h2>Feature Selection</h2>
</hgroup>
<article>
<h3>Comparison</h3>
<table><thead>
<tr>
<th></th>
<th align="center">Wrapper</th>
<th align="right">Filter</th>
<th align="right">Embedded</th>
</tr>
</thead><tbody>
<tr>
<td>Computational Speed</td>
<td align="center">Low</td>
<td align="right">High</td>
<td align="right">Mid</td>
</tr>
<tr>
<td>Chance of Overfitting</td>
<td align="center">High</td>
<td align="right">Low</td>
<td align="right">Mid</td>
</tr>
<tr>
<td>Classifier-Independent</td>
<td align="center">No</td>
<td align="right">Yes</td>
<td align="right">No</td>
</tr>
</tbody></table>
<ul>
<li>Wrapper methods have the strongest learning/representation capability among the three
<ul>
<li>often fit training dataset better than the other two</li>
<li>prone to overfitting for small datasets</li>
<li>require more data to reliably get a near-optimal approximation. </li>
</ul></li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-12" style="background:;">
<hgroup>
<h2>Feature Extraction</h2>
</hgroup>
<article>
<div class='left' style='float:left;width:50%'>
<h3>Principle Components Analysis</h3>
<ul>
<li><b>A graphical explanation</b>
<ul>
<li>Each data sample has three features</li>
<li>Original features are transformed into new ones</li>
<li>Often use only the new features with largest variance</li>
</ul></li>
<li><b>Example</b>
<ul>
<li>For fMRI images, we usually have millions of dimensions. PCA can project the data from millions of dimensions to only thousands of dimensions, or even less</li>
</ul></li>
<li>Other feature extraction methods: ICA, Kernel PCA , etc..</li>
</ul>
</div>
<div class='right' style='float:right;width:48%'>
<p><center><img src="assets/img/pca.png" alt="alt text" title="Principle component analysis"></center></p>
<p><center><img src="assets/img/pca_var.png" alt="alt text" title="Principle component analysis"></center></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-13" style="background:;">
<hgroup>
<h2>Part 2: Linear Regression and Least Squares (Review)</h2>
</hgroup>
<article>
<ol>
<li>Introduction to Dimensionality Reduction</li>
<li><b>Linear Regression and Least Squares (Review)</b>
<ul>
<li><b>Least Square Fit</b></li>
<li><b>Gauss Markov</b></li>
<li><b>Bias-Variance tradeoff</b></li>
<li><b>Problems</b></li>
</ul></li>
<li>Subset Selection</li>
<li>Shrinkage Methods</li>
<li>Beyond LASSO</li>
</ol>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-14" style="background:;">
<hgroup>
<h2>Linear Regression and Least Squares (Review)</h2>
</hgroup>
<article>
<div class='left' style='float:left;width:58%'>
<h3>Least Squares Fit</h3>
<p>\[
\begin{equation}
\begin{split}
RSS(\beta) &= (\mathbf{y} - \mathbf{X}\beta)^T(\mathbf{y} - \mathbf{X}\beta)\\
\frac{\partial RSS}{\partial \beta} &= -2 \mathbf{X}^T(\mathbf{y} - \mathbf{X}\beta) = 0
\quad \Rightarrow \quad \hat{\beta}^{ls} = (\mathbf{X}^T\mathbf{X})^{-1}\mathbf{X}^T\mathbf{y}
\end{split}
\end{equation}
\]</p>
<h3>Gauss Markov Theorem</h3>
<p>The least squares estimates \(\hat{\beta}^{ls}\) of the parameters β have the smallest variance among all linear unbiased estimates.</p>
<h3>Question</h3>
<p>Is it good to be unbiased?</p>
</div>
<div class='right' style='float:right;width:38%'>
<p><img src="assets/img/lr.png" alt="Linear regression" title="Linear regression"></p>
<p><img src="assets/img/ls.png" alt="Least Squares" title="Least squares"></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-15" style="background:;">
<hgroup>
<h2>Linear Regression and Least Squares (Review)</h2>
</hgroup>
<article>
<h3>Bias-Variance tradeoff</h3>
<p>\[
\begin{equation}
\begin{split}
MSE(\hat{\mathbf{y}}) &= E[(\hat{\mathbf{y}} - Y)^2]\\
&= Var(\hat{\mathbf{y}}) + [E[\hat{\mathbf{y}}] - Y]^2
\end{split}
\end{equation}
\]</p>
<p>where \(Y = X^T\beta\). We can trade increase in bias for much less variance.</p>
<h3>Problems of Least Squares</h3>
<ul>
<li><b>Prediction accuracy</b>: unbiased, but higher variance than many biased estimator (leading to higher MSE), overfitting noise and sensitive to outliers</li>
<li><b>Interpretation</b>: \(\hat{\beta}\) involves all of the features.
Better to have SIMPLER linear model, that involves only a few features...</li>
<li>Recall that \(\hat{\beta}^{ls} = (\mathbf{X}^T\mathbf{X})^{-1}\mathbf{X}^T\mathbf{y}\)
<ul>
<li>\((\mathbf{X}^T\mathbf{X})\) may be <b>not invertible</b> and thus no closed form solution</li>
</ul></li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-16" style="background:;">
<hgroup>
<h2>Part 3: Subset Selection Methods</h2>
</hgroup>
<article>
<ol>
<li>Introduction to Dimensionality Reduction</li>
<li>Linear Regression and Least Squares (Review)</li>
<li><b>Subset Selection</b>
<ul>
<li><b>Best-subset selection</b></li>
<li><b>Forward stepwise selection</b></li>
<li><b>Forward stagewise selection</b></li>
<li><b>Problems</b></li>
</ul></li>
<li>Shrinkage Methods</li>
<li>Beyond LASSO</li>
</ol>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-17" style="background:;">
<hgroup>
<h2>Subset Selection Methods</h2>
</hgroup>
<article>
<h3>Best-subset selection</h3>
<ul>
<li>Best subset regression finds for each \(k \in \{0, 1, 2, . . . , p\}\) the subset of features of size \(k\) that gives smallest RSS. </li>
<li>Then cross validation is utilized to choose the best \(k\)</li>
<li>An efficient algorithm, the leaps and bounds procedure (Furnival and Wilson, 1974), makes this feasible for \(p\) as large as 30 or 40.</li>
</ul>
<p><center><img src="assets/img/best_sub.png" alt="best_sub" title="best_sub"></center></p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-18" style="background:;">
<hgroup>
<h2>Subset Selection Methods</h2>
</hgroup>
<article>
<h3>Forward-STEPWISE selection</h3>
<p>Instead of searching all possible subsets, we can seek a good path through them. </p>
<ul>
<li>a <b>sequential greedy</b> algorithm.</li>
</ul>
<p><em>Forward-Stepwise Selection</em> builds a model sequentially, adding one variable at a time. </p>
<ul>
<li>Initialization
<ul>
<li>Active set \(\mathcal{A} = \emptyset\), \(\mathbf{r} = \mathbf{y}\), \(\beta = 0\)</li>
</ul></li>
<li>At each step, it
<ul>
<li>identifies the best variable (with the highest correlation with the residual error)
\[\mathbf{k} = argmax_{j}(|correlation(\mathbf{x}_j, \mathbf{r})|)\]</li>
<li>\(A = A \cup \{\mathbf{k}\}\)</li>
<li>then updates the least squares fit \(\beta\), \(\mathbf{r}\) to include all the active variables</li>
</ul></li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-19" style="background:;">
<hgroup>
<h2>Subset Selection Methods</h2>
</hgroup>
<article>
<h3>Forward-STAGEWISE Regression</h3>
<div class='left' style='float:left;width:55%'>
<ul>
<li>Initialize the fit vector \(\mathbf{f} = 0\)</li>
<li>For each time step
<ul>
<li>Compute the correlation vector
\[\mathbf{c} = (\mathbf{c}_1, ..\mathbf{c}_p)\]
<ul>
<li>\(\mathbf{c}_j\) represents the correlation between \(\mathbf{x}_j\) and the residual error</li>
</ul></li>
<li>\(k = argmax_{j \in \{1,2,..,p\}} |\mathbf{c}_j|\)</li>
<li>Coefficients and fit vector are updated
\[\mathbf{f} \gets \mathbf{f} + \alpha \cdot sign(\mathbf{c}_k) \mathbf{x}_k\]
\[\beta_k \gets \beta_k + \alpha \cdot sign(\mathbf{c}_k)\]
where \(\alpha\) is the learning rate</li>
</ul></li>
</ul>
</div>
<div class='right' style='float:right;width:43%'>
<p><img src="assets/img/stagewise.png" alt="Stagewise" title="Stagewise"></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-20" style="background:;">
<hgroup>
<h2>Subset Selection Methods</h2>
</hgroup>
<article>
<h3>Comparison</h3>
<div class='left' style='float:left;width:40%'>
<ul>
<li>Forward-STEPWISE selection:
<ul>
<li>algorithm stops in \(p\) steps</li>
</ul></li>
<li>Forward-STAGEWISE selection:
<ul>
<li>is a slow fitting algorithm, at each time step, only \(\beta_k\) is updated. Alg can take more than \(p\) steps to stop</li>
</ul></li>
</ul>
</div>
<div class='right' style='float:right;width:55%'>
<p><center><img src="assets/img/comp1.png" alt="comp1" title="comp"></center></p>
<ul>
<li>\(N = 300\) Observations, \(p = 31\) features</li>
<li>averaged over 50 simulations</li>
</ul>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-21" style="background:;">
<hgroup>
<h2>Summary of Subset Selection Methods</h2>
</hgroup>
<article>
<h3>Advantages w.r.t Least Squares</h3>
<ul>
<li>More interpretable result</li>
<li>More compact model</li>
</ul>
<h3>Disadvantages w.r.t. Continuos Process</h3>
<ul>
<li>It is a discrete process, and thus has high variance and is very sensitive to changes in the dataset
<ul>
<li>If the dataset changes a little, the feature selection result may be very different<br></li>
</ul></li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-22" style="background:;">
<hgroup>
<h2>Part 4: Shrinkage Methods</h2>
</hgroup>
<article>
<ol>
<li>Introduction to Dimensionality Reduction</li>
<li>Linear Regression and Least Squares (Review)</li>
<li>Subset Selection</li>
<li><b>Shrinkage Methods</b>
<ul>
<li><b>Ridge Regression</b>
<ul>
<li><b>Formulations and closed form solution</b></li>
<li><b>Singular value decomposition</b></li>
<li><b>Degree of Freedom</b></li>
</ul></li>
<li>LASSO</li>
</ul></li>
<li>Beyond LASSO</li>
</ol>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-23" style="background:;">
<hgroup>
<h2>Ridge Regression</h2>
</hgroup>
<article>
<ul>
<li><b>Least squares with quadratic constraints</b>
\[
\begin{equation}
\hat{\beta}^{ridge}= argmin_{\beta}\sum_{i=1}^N(y_i - \beta_0 - \sum_{j=1}^p\mathbf{x}_{ij}\beta_j)^2, \quad s.t. \quad \sum_{j = 1}^p \beta_j^2 \leq t
\end{equation}
\]</li>
<li><b>Its Lagrange form</b>
\[
\hat{\beta}^{ridge} = argmin_{\beta}\sum_{i=1}^N(y_i - \beta_0 - \sum_{j=1}^p\mathbf{x_{ij}}\beta_j)^2 + \lambda \sum_{j = 1}^p\beta_j^2
\]</li>
<li><p>The \(l_2\)-regularization can be viewed as a Gaussian prior on the coefficients, our solution as the posterior means</p></li>
<li><p><b>Solution</b></p></li>
</ul>
<p>\[
\begin{equation}
\begin{split}
&RSS(\beta) = (\mathbf{y} - \mathbf{X}\beta)^T(\mathbf{y} - \mathbf{X}\beta) + \lambda \beta^T\beta\\
&\partial RSS(\beta)/ \partial \beta = 0 \quad \Rightarrow\quad \hat{\beta}^{ridge} = (\mathbf{X}^T\mathbf{X} + \lambda \mathbf{I})^{-1}\mathbf{X}^T\mathbf{y}
\end{split}
\end{equation}
\] </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-24" style="background:;">
<hgroup>
<h2>Ridge Regression</h2>
</hgroup>
<article>
<h3>Simulation Experiment</h3>
<div class='left' style='float:left;width:50%'>
<ul>
<li>\(N = 30\)</li>
<li>\(\mathbf{x}_1 \sim N(0, 1)\)</li>
<li>\(\beta \sim (U(-0.5,0.5), U(-0.5,0.5))\)</li>
</ul>
</div>
<div class='right' style='float:right;width:50%'>
<ul>
<li>\(\mathbf{y} = (\mathbf{x}_1, \mathbf{x}_1^2) \times \beta\)</li>
<li>\(\mathbf{X} = (\mathbf{x}_1, \mathbf{x}^2_1, ..., \mathbf{x}^8_1)\)</li>
<li>Dataset avalible: {\(\mathbf{X}\), \(\mathbf{y}\)}</li>
</ul>
</div>
<div style='float:left;width:100%;' class='centered'>
<p><center><img src="assets/img/lst.png" alt="lst" title="lst"></center></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-25" style="background:;">
<hgroup>
<h2>Ridge Regression</h2>
</hgroup>
<article>
<h3>Singular Value Decomposition (SVD)</h3>
<p>SVD offers some additional insight into the nature of ridge regression. </p>
<div class='left' style='float:left;width:50%'>
<ul>
<li><b>The SVD of</b> \(\mathbf{X}\):
\[\mathbf{X} = \mathbf{UDV}^T\]
<ul>
<li>\(\mathbf{U}\): \(N \times p\) <b>orthogonal</b> matrix with columns spanning the column space of \(\mathbf{X}\).
<ul>
<li>\(\mathbf{u}_j\) is the $j$th column of \(\mathbf{U}\)</li>
</ul></li>
<li>\(\mathbf{V}\): \(p \times p\) <b>orthogonal</b> matrix with columns spanning the row space of \(\mathbf{X}\).
<ul>
<li>\(\mathbf{v}_j\) is the $j$th column of \(\mathbf{V}\)<br></li>
</ul></li>
<li>\(\mathbf{D}\): \(p \times p\) <b>diagonal</b> matrix with diagonal entries \(d_1 \geq d_2 \geq ... \geq d_p \geq 0\) being the singular values of \(\mathbf{X}\)</li>
</ul></li>
</ul>
</div>
<div class='right' style='float:right;width:50%'>
<p><center><img src="assets/img/svd2.png" alt="svd2" title="svd2"></center></p>
<p><center><img src="assets/img/svd.gif" alt="svd" title="svd"></center></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-26" style="background:;">
<hgroup>
<h2>Ridge Regression</h2>
</hgroup>
<article>
<h3>Singular Value Decomposition (SVD)</h3>
<div class='left' style='float:left;width:50%'>
<ul>
<li><b>For least squares</b>
\[
\begin{equation}
\begin{split}
\mathbf{X}\hat{\beta}^{ls} &= \mathbf{X(X^TX)^{-1}X^Ty}\\
&=\mathbf{UU^Ty} =\sum_{j=1}^p\mathbf{u}_j \mathbf{u}_j^T\mathbf{y}
\end{split}
\end{equation}
\]</li>
</ul>
</div>
<div class='right' style='float:right;width:50%'>
<ul>
<li><b>For ridge regression</b>
\[
\begin{equation}
\begin{split}
\mathbf{X}\hat{\beta}^{ridge} &= \mathbf{X(X^TX + \lambda I)^{-1}X^Ty}\\
&=\sum_{j=1}^p\mathbf{u}_j\frac{d_j^2}{d_j^2 + \lambda} \mathbf{u}_j^T\mathbf{y}
\end{split}
\end{equation}
\]</li>
</ul>
</div>
<div style='float:left;width:100%;' class='centered'>
<ul>
<li>Compared with the solution of least squares, we have an additional shrinkage term
\[\frac{d_j^2}{d_j^2 + \lambda},\]
the smaller \(d_j\) is and the larger \(\lambda\) is, the more shrinkage we have. </li>
</ul>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-27" style="background:;">
<hgroup>
<h2>Ridge Regression</h2>
</hgroup>
<article>
<h3>Singular Value Decomposition (SVD)</h3>
<div class='left' style='float:left;width:55%'>
<ul>
<li>\(N = 100\), \(p = 10\)</li>
</ul>
<p><img src="assets/img/ls_pc.png" alt="ls_pc" title="ls_pc"></p>
<p><img src="assets/img/rr_pc.png" alt="rr_pc" title="rr_pc"></p>
</div>
<div class='right' style='float:right;width:45%'>
<p><center><img src="assets/img/shrink.png" alt="shrink" title="shrink"></center></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-28" style="background:;">
<hgroup>
<h2>Ridge Regression</h2>
</hgroup>
<article>
<h3>Degree of Freedom</h3>
<div class='left' style='float:left;width:50%'>
<ul>
<li>The number of degrees of freedom is the number of values in the final calculation of a statistic that are free to vary. The degree of freedom of ridge estimate is related to \(\lambda\), thus defined as \(df(\lambda)\).</li>
<li>Computation
\[
\begin{equation}
\begin{split}
df(\lambda) &= tr[\mathbf{X(X^TX + \lambda I)^{-1}X^T}]\\
&=\sum_{j=1}^p \frac{d_j^2}{d_j^2 + \lambda}
\end{split}
\end{equation}
\]</li>
<li>[larger \(\lambda\)] \(\rightarrow\) [smaller \(df(\lambda)\)] \(\rightarrow\) [more constrained model]</li>
<li>The red line gives the best \(df(\lambda)\) identified from cross validation w.r.t RSS</li>
</ul>
</div>
<div class='right' style='float:right;width:48%'>
<p><center><img src="assets/img/df.png" alt="df" title="df"></center></p>
</div>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-29" style="background:;">
<hgroup>
<h2>Ridge Regression</h2>
</hgroup>
<article>
<h4>Advantages</h4>
<ul>
<li> w.r.t. Least Squares
<ul>
<li>\((\mathbf{X^TX + \lambda I})\) is always invertible and thus the closed form solution always exist</li>
<li>Ridge regression controls the complexity with regularization term via \(\lambda\), which is less prone to overfitting compared with least squares fit, </li>
<li>Possibly higher prediction accuracy, as the estimates of ridge regression trade a little bias for less variance</li>
</ul></li>
<li> w.r.t. Subset Selection Methods
<ul>
<li>Ridge regression is a continuous shrinkage method that has less variance than subset selection methods</li>
</ul></li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-30" style="background:;">
<hgroup>
<h2>Ridge Regression</h2>
</hgroup>
<article>
<h4>Disadvantages w.r.t. Subset Selection Methods</h4>
<ul>
<li>Compactness:
<ul>
<li>Computational efficiency:
<ul>
<li>though we have a closed form solution, computing matrix inversions takes time and memory</li>
<li>it takes longer to predict for future samples with more features</li>
</ul></li>
</ul></li>
<li>Interpretation<br>
<ul>
<li>offers little interpretations </li>
</ul></li>
</ul>
</article>
<!-- Presenter Notes -->
</slide>