/
2013-02-08-Preprocessing.html
940 lines (750 loc) · 26.9 KB
/
2013-02-08-Preprocessing.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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>2013-02-08-Preprocessing</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<meta name="title" content="2013-02-08-Preprocessing"/>
<meta name="generator" content="Org-mode"/>
<meta name="generated" content="2013-02-08 13:49:51 PST"/>
<meta name="author" content="Jim Blomo"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<link rel="stylesheet" type="text/css" href="production/common.css" />
<link rel="stylesheet" type="text/css" href="production/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="production/projection.css" media="projection" />
<link rel="stylesheet" type="text/css" href="production/color-blue.css" media="projection" />
<link rel="stylesheet" type="text/css" href="production/presenter.css" media="presenter" />
<link href='http://fonts.googleapis.com/css?family=Lobster+Two:700|Yanone+Kaffeesatz:700|Open+Sans' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="preamble">
</div>
<div id="content">
<h1 class="title">2013-02-08-Preprocessing</h1>
<div id="table-of-contents">
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
<li><a href="#sec-1">1 Preprocessing</a></li>
<li><a href="#sec-2">2 Real World is Dirty</a>
<ul>
<li><a href="#sec-2-1">2.1 Types of dirty</a></li>
</ul>
</li>
<li><a href="#sec-3">3 Causes of Problems</a>
<ul>
<li><a href="#sec-3-1">3.1 Problems</a></li>
<li><a href="#sec-3-2">3.2 Inconsistent Different Sources</a></li>
<li><a href="#sec-3-3">3.3 Business names</a></li>
</ul>
</li>
<li><a href="#sec-4">4 Preprocessing</a>
<ul>
<li><a href="#sec-4-1">4.1 Flu Trend Problems (Questions)</a></li>
</ul>
</li>
<li><a href="#sec-5">5 Missing Values</a>
<ul>
<li><a href="#sec-5-1">5.1 What to do?</a></li>
</ul>
</li>
<li><a href="#sec-6">6 Fill Missing Values</a>
<ul>
<li><a href="#sec-6-1">6.1 Details</a></li>
</ul>
</li>
<li><a href="#sec-7">7 Normalization</a>
<ul>
<li><a href="#sec-7-1">7.1 Context, Comparison</a></li>
</ul>
</li>
<li><a href="#sec-8">8 Min-max</a>
<ul>
<li><a href="#sec-8-1">8.1 New Range</a></li>
</ul>
</li>
<li><a href="#sec-9">9 Z-score</a>
<ul>
<li><a href="#sec-9-1">9.1 Uses</a></li>
</ul>
</li>
<li><a href="#sec-10">10 Comparison</a>
<ul>
<li><a href="#sec-10-1">10.1 Min-max vs Z-score</a></li>
</ul>
</li>
<li><a href="#sec-11">11 Removing Noise</a>
<ul>
<li><a href="#sec-11-1">11.1 Monitoring Problem</a></li>
<li><a href="#sec-11-2">11.2 Trade-offs</a>
<ul>
<li><a href="#sec-11-2-1">11.2.1 Trade-offs again</a></li>
</ul></li>
</ul>
</li>
<li><a href="#sec-12">12 Data integration</a>
<ul>
<li><a href="#sec-12-1">12.1 Yelp Menu Data</a></li>
</ul>
</li>
<li><a href="#sec-13">13 Other measures of "close"</a>
<ul>
<li><a href="#sec-13-1">13.1 Correlation</a></li>
</ul>
</li>
<li><a href="#sec-14">14 Χ<sup>2</sup> Correlation Test</a>
<ul>
<li><a href="#sec-14-1">14.1 Motivation</a></li>
</ul>
</li>
<li><a href="#sec-15">15 Covariance & Correlation</a>
<ul>
<li><a href="#sec-15-1">15.1 Use in industry</a></li>
</ul>
</li>
<li><a href="#sec-16">16 Data Reduction</a>
<ul>
<li><a href="#sec-16-1">16.1 Deep Dive</a></li>
</ul>
</li>
<li><a href="#sec-17">17 Subset Selection</a>
<ul>
<li><a href="#sec-17-1">17.1 Simple to Sophisticated</a></li>
</ul>
</li>
<li><a href="#sec-18">18 Principal Component Analysis</a>
<ul>
<li><a href="#sec-18-1">18.1 Higher dimensions</a></li>
</ul>
</li>
<li><a href="#sec-19">19 Netflix and PCA</a>
<ul>
<li><a href="#sec-19-1">19.1 Summarize in discovered dimensions</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div id="outline-container-1" class="outline-2">
<h2 id="sec-1"><span class="section-number-2">1</span> Preprocessing <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-1">
</div>
</div>
<div id="outline-container-2" class="outline-2">
<h2 id="sec-2"><span class="section-number-2">2</span> Real World is Dirty <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-2">
<dl>
<dt>Incomplete</dt><dd>missing timestamps for actions
</dd>
<dt>Noisy</dt><dd>salary = -10
</dd>
<dt>Inconsistent</dt><dd>age: 42, birthday: 1997-03-07
</dd>
</dl>
</div>
<div id="outline-container-2-1" class="outline-3">
<h3 id="sec-2-1"><span class="section-number-3">2.1</span> Types of dirty <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-2-1">
<dl>
<dt>Incomplete</dt><dd>lacking some attribute values, containing only aggregate
data. Eg. We often regret not including timestamps on different actions
like UFCing, instead of tracking total votes (aggregation)
</dd>
<dt>Noisy</dt><dd>Containing errors, like impossible salary data, or decimals in the
wrong place
</dd>
<dt>Inconsistent</dt><dd>If there's every two fields that depend on each other, in a
large dataset you'll find them disagreeing. Errors ofen come from failures:
processes failing halfway into updating
</dd>
</dl>
</div>
</div>
</div>
<div id="outline-container-3" class="outline-2">
<h2 id="sec-3"><span class="section-number-2">3</span> Causes of Problems <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-3">
<ul>
<li>Humans
</li>
<li>Software
</li>
<li>Hardware
</li>
</ul>
</div>
<div id="outline-container-3-1" class="outline-3">
<h3 id="sec-3-1"><span class="section-number-3">3.1</span> Problems <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-3-1">
<ul>
<li>Berkeley experiment to measure temperature across campus
</li>
<li>Turned out average on campus much warmer than external weather services
predicted
</li>
<li>But sample data looked in line with predictions
</li>
<li>Problem: one monitoring station right next to air conditioning unit!
</li>
<li>Hardware failure rare, but with large numbers of machines, probable. Eg.
RAM can suffer ~1 bit/hour/gigabyte (ECC can help)
</li>
</ul>
</div>
</div>
<div id="outline-container-3-2" class="outline-3">
<h3 id="sec-3-2"><span class="section-number-3">3.2</span> Inconsistent Different Sources <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-3-2">
<ul>
<li>Great value in combining data sources
</li>
<li>Challenge is merging them together, removing duplicates
</li>
<li>Example: Business names
</li>
</ul>
</div>
</div>
<div id="outline-container-3-3" class="outline-3">
<h3 id="sec-3-3"><span class="section-number-3">3.3</span> Business names <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-3-3">
<ul>
<li>Starbucks vs. Starbucks Coffee Shop
</li>
<li>Buck's vs Bucks
</li>
<li>Trying to use address? Stackbucks vs. Starbucks across the street
</li>
<li>Best strategy here is to use DM/ML techniques on the <b>combination</b> of
features to determine likelihood of match. We'll discuss specific
algorithms later in the course
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-4" class="outline-2">
<h2 id="sec-4"><span class="section-number-2">4</span> Preprocessing <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-4">
<dl>
<dt>Cleaning</dt><dd>fill missing values, smooth noisy data, identify or remove
outliers, resolve inconsistencies
</dd>
<dt>Integration</dt><dd>merging data from multiple sources
</dd>
<dt>Reduction</dt><dd>obtain a smaller data set that can sufficiently answer
important questions
</dd>
<dt>Transformation</dt><dd>change data to a form that is easier to mine or analyze
</dd>
</dl>
</div>
<div id="outline-container-4-1" class="outline-3">
<h3 id="sec-4-1"><span class="section-number-3">4.1</span> Flu Trend Problems (Questions) <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-4-1">
<ul>
<li>We have millisecond search resolution, but will only be plotting on a per day basis
</li>
<li>We have the exact text of each query, but just care if it is about the flu or not
</li>
<li>Flu Trends, we sometimes see out of control search bots doing 100,000s of searches per day
</li>
<li>Mobile phone searches and web searches hit different machines, software, logs
</li>
<li>We have IPs in the logs, but will by plotting against geographical areas
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-5" class="outline-2">
<h2 id="sec-5"><span class="section-number-2">5</span> Missing Values <span class="tag"><span class="slide">slide</span> <span class="two_col">two_col</span></span></h2>
<div class="outline-text-2" id="text-5">
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col class="left" /><col class="left" />
</colgroup>
<tbody>
<tr><td class="left">Person</td><td class="left">Height</td></tr>
<tr><td class="left">Jim</td><td class="left">6'0</td></tr>
<tr><td class="left">Ashley</td><td class="left">-</td></tr>
<tr><td class="left">Sam</td><td class="left">5'11</td></tr>
<tr><td class="left">Alice</td><td class="left">5'9</td></tr>
<tr><td class="left">Kate</td><td class="left">-</td></tr>
</tbody>
</table>
<p>
<img src="img/tallest-shortest-man.jpg" alt="img/tallest-shortest-man.jpg" />
</p>
</div>
<div id="outline-container-5-1" class="outline-3">
<h3 id="sec-5-1"><span class="section-number-3">5.1</span> What to do? <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-5-1">
<ul>
<li>(Heights are made up)
</li>
<li>We want to get an average class height
</li>
<li>Q: What to do with missing rows?
</li>
<li>ignore, fill, constant, average, average wrt gender
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-6" class="outline-2">
<h2 id="sec-6"><span class="section-number-2">6</span> Fill Missing Values <span class="tag"><span class="slide">slide</span> <span class="animate">animate</span></span></h2>
<div class="outline-text-2" id="text-6">
<ul>
<li>Ignore the record
</li>
<li>Find value manually
</li>
<li>Global constant
</li>
<li>Average
</li>
<li>Average with respect to class
</li>
<li>"Most probable"
</li>
</ul>
</div>
<div id="outline-container-6-1" class="outline-3">
<h3 id="sec-6-1"><span class="section-number-3">6.1</span> Details <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-6-1">
<dl>
<dt>Trade-offs</dt><dd>core to engineering
</dd>
<dt>Ignore</dt><dd>simply drop from data set. Hope there are not too many to affect
answer. Drawbacks? When missing values are all same class (skew data)
</dd>
<dt>Find value manually</dt><dd>Even for a small class, might be difficult. Get
ruler, measure them. For historical data, impossible.
</dd>
<dt>Global constant</dt><dd>replace with "N/A" or "6 foot". Can skew data, or cause
data to pop in other analysis (all grouped together)
</dd>
<dt>Average</dt><dd>Mean or median. Either one has potential problems.
</dd>
<dt>Average with respect to class</dt><dd>gender. Average female/male height to fill
in values
</dd>
<dt>"Most probable"</dt><dd>Think of as another step from avg -> class avg. Now
throw in other details: age, family history, shoe size. Then weight
depending on how much those factors are correlated. Pretty soon you have a
regression or Bayesian model, which will cover later
</dd>
</dl>
</div>
</div>
</div>
<div id="outline-container-7" class="outline-2">
<h2 id="sec-7"><span class="section-number-2">7</span> Normalization <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-7">
<ul>
<li>Type of data transformation to make reasoning and comparison easier
</li>
<li>Is 6' tall?
</li>
<li>Coefficients on attributes in regressions understandable
</li>
</ul>
</div>
<div id="outline-container-7-1" class="outline-3">
<h3 id="sec-7-1"><span class="section-number-3">7.1</span> Context, Comparison <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-7-1">
<ul>
<li>6' Might be tall for this class, but not on a basketball team
</li>
<li>How to know when a data point "average" or towards the top of a range?
</li>
<li>For our housing model, we wanted to use sq. footage and # of bedrooms. But
the sq. footage number is huge compared to bedrooms. If we didn't
normalize, a formula for determine house price might seem to indicate that
# of bedrooms was way more important
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-8" class="outline-2">
<h2 id="sec-8"><span class="section-number-2">8</span> Min-max <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-8">
<p><img src="img/min-max.gif" alt="img/min-max.gif" />
</p>
</div>
<div id="outline-container-8-1" class="outline-3">
<h3 id="sec-8-1"><span class="section-number-3">8.1</span> New Range <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-8-1">
<ul>
<li>Typically new range is
<ul>
<li>[0-1] (thought of as %)
</li>
<li>[-1-1] (though of as bad->good
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-9" class="outline-2">
<h2 id="sec-9"><span class="section-number-2">9</span> Z-score <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-9">
<p><img src="img/z-score.gif" alt="img/z-score.gif" />
</p>
</div>
<div id="outline-container-9-1" class="outline-3">
<h3 id="sec-9-1"><span class="section-number-3">9.1</span> Uses <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-9-1">
<ul>
<li>When you want a relative measure of deviation
</li>
<li>When you have a distribution estimate, but are unsure of absolute min-max
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-10" class="outline-2">
<h2 id="sec-10"><span class="section-number-2">10</span> Comparison <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-10">
<p><img src="img/outliers.png" alt="img/outliers.png" />
<img src="img/outliers-minmax-zscore.png" alt="img/outliers-minmax-zscore.png" />
</p>
</div>
<div id="outline-container-10-1" class="outline-3">
<h3 id="sec-10-1"><span class="section-number-3">10.1</span> Min-max vs Z-score <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-10-1">
<ul>
<li>Min-max: Known range
</li>
<li>Z-score: more expressive range
</li>
<li>Min-max: requires knowing min-max
</li>
<li>Z-score: can estimate with sampling or informed guess
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-11" class="outline-2">
<h2 id="sec-11"><span class="section-number-2">11</span> Removing Noise <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-11">
<dl>
<dt>Binning</dt><dd>create B bins << N data samples, use aggregate statistic of bin
for value
</dd>
<dt>Regression</dt><dd>fit data to a function, use function value
</dd>
<dt>Outlier analysis</dt><dd>find outlying points, understand and/or ignore them
</dd>
</dl>
</div>
<div id="outline-container-11-1" class="outline-3">
<h3 id="sec-11-1"><span class="section-number-3">11.1</span> Monitoring Problem <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-11-1">
<ul>
<li>For the problem encountered in temperature monitoring, which makes the most
sense?
</li>
</ul>
</div>
</div>
<div id="outline-container-11-2" class="outline-3">
<h3 id="sec-11-2"><span class="section-number-3">11.2</span> Trade-offs <span class="tag"><span class="slide">slide</span></span></h3>
<div class="outline-text-3" id="text-11-2">
<dl>
<dt>Binning</dt><dd>Simple way to remove outliers, but difficult to pick buckets
correctly
</dd>
<dt>Regression</dt><dd>If one metric is a direct function of another, what extra
information does the value provide?
</dd>
<dt>Outlier analysis</dt><dd>Manual process of understanding outliers, ignoring them
can obscure some analysis (eg. income disparity)
</dd>
</dl>
</div>
<div id="outline-container-11-2-1" class="outline-4">
<h4 id="sec-11-2-1"><span class="section-number-4">11.2.1</span> Trade-offs again <span class="tag"><span class="notes">notes</span></span></h4>
<div class="outline-text-4" id="text-11-2-1">
<ul>
<li>Remember: this class is exposing you to potential tools, up to you to be
asking the right questions, selecting the appropriate algorithms,
interpreting results
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="outline-container-12" class="outline-2">
<h2 id="sec-12"><span class="section-number-2">12</span> Data integration <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-12">
<ul>
<li>Merging two data sources
</li>
<li>Problem: uniquely identify a concept in both sources
</li>
<li>Find data points that are very "close" to each other, call them the same
with some probability
</li>
<li>Example: <a href="http://www.yelp.com/menu/tartine-bakery-san-francisco">Yelp Menu Data</a>
</li>
</ul>
</div>
<div id="outline-container-12-1" class="outline-3">
<h3 id="sec-12-1"><span class="section-number-3">12.1</span> Yelp Menu Data <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-12-1">
<ul>
<li>Recently launched menu data
</li>
<li>Takes data about the restaurant menu, find reviews & pictures referring to
the menu item
</li>
<li>Joins them together
</li>
<li>Many different metrics for "close": remember them?
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-13" class="outline-2">
<h2 id="sec-13"><span class="section-number-2">13</span> Other measures of "close" <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-13">
<p>Are <code>A</code> and <code>B</code> close?
</p><table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<caption></caption>
<colgroup><col class="right" /><col class="right" />
</colgroup>
<tbody>
<tr><td class="right">A</td><td class="right">B</td></tr>
<tr><td class="right">2</td><td class="right">60</td></tr>
<tr><td class="right">5</td><td class="right">150</td></tr>
<tr><td class="right">6</td><td class="right">180</td></tr>
<tr><td class="right">10</td><td class="right">300</td></tr>
<tr><td class="right">13</td><td class="right">390</td></tr>
</tbody>
</table>
</div>
<div id="outline-container-13-1" class="outline-3">
<h3 id="sec-13-1"><span class="section-number-3">13.1</span> Correlation <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-13-1">
<ul>
<li>Imagine <code>A</code> and <code>B</code> have several different dimensions, maybe things like
length, height, width, radius
</li>
<li>Are they similar?
</li>
<li>On one hand no: clearly different order of magnitude
</li>
<li>Another way to think about similarity is correlation
</li>
<li>All of <code>B</code> dimensions are 30x of <code>A</code>
</li>
<li>Maybe just using different units!
</li>
<li>If I plotted <code>A</code> and <code>B</code> and x,y, what would the result look like?
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-14" class="outline-2">
<h2 id="sec-14"><span class="section-number-2">14</span> Χ<sup>2</sup> Correlation Test <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-14">
<p> <img src="img/correlation.png" alt="img/correlation.png" />
<img src="img/chiequation.jpg" alt="img/chiequation.jpg" />
</p>
</div>
<div id="outline-container-14-1" class="outline-3">
<h3 id="sec-14-1"><span class="section-number-3">14.1</span> Motivation <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-14-1">
<ul>
<li>Answer: a straight line
</li>
<li>So a correlation coefficient gives a sense of how closely <b>linearly</b>
related two data sets are
</li>
<li>Note, besides positive & negative, the slop does not affect the correlation
score, just how well fit the data is
</li>
<li>Also note I said linear: patterns may still be exhibited, but they are not
linearly related, eg 30x
</li>
<li>Details of test are in book, you are expected to understand it
</li>
<li>Motivation: how different are the observed values from the expected?
</li>
<li>Expected is calculated using probability with the assumptions that the sets
are <b>independent</b>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-15" class="outline-2">
<h2 id="sec-15"><span class="section-number-2">15</span> Covariance & Correlation <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-15">
<ul>
<li>Correlation is "normalized" covariance
</li>
<li>Covariance describes the degree to which two data sets track each other in
units of of the two data sets
</li>
<li>Correlations describes the degree of similarity without units
</li>
</ul>
</div>
<div id="outline-container-15-1" class="outline-3">
<h3 id="sec-15-1"><span class="section-number-3">15.1</span> Use in industry <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-15-1">
<ul>
<li>Χ<sup>2</sup> used most commonly, handy to have an expected [0-1] range
</li>
<li>"Correlation does not imply causation"
</li>
<li>A->B, B->A, C->A,B, A->B->A…, coincidence
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-16" class="outline-2">
<h2 id="sec-16"><span class="section-number-2">16</span> Data Reduction <span class="tag"><span class="slide">slide</span> <span class="two_col">two_col</span></span></h2>
<div class="outline-text-2" id="text-16">
<dl>
<dt>Dimensionality</dt><dd>remove attributes that are the same or similar to other
attributes
</dd>
<dt>Numerosity</dt><dd>represent or aggregate the data, sometimes with precision loss
</dd>
<dt>Compression</dt><dd>generalized techniques to decrease the number of bytes needed
to store data
</dd>
</dl>
<p><img src="img/compress-car.jpg" alt="img/compress-car.jpg" />
</p>
</div>
<div id="outline-container-16-1" class="outline-3">
<h3 id="sec-16-1"><span class="section-number-3">16.1</span> Deep Dive <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-16-1">
<ul>
<li>We're only going to cover selected topics in these areas.
</li>
<li>When reading, make sure to understand the intuition behind the other
techniques, but if we don't cover it in lecture, you won't need to
calculate it in midterm
</li>
<li>Ask questions about the concepts you don't understand! That's what
separates this class from a book :)
</li>
<li>But still potentially useful for your projects!
</li>
<li>img: <a href="http://www.flickr.com/photos/marcovdz/4520986339/sizes/o/in/photostream/">http://www.flickr.com/photos/marcovdz/4520986339/sizes/o/in/photostream/</a>
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-17" class="outline-2">
<h2 id="sec-17"><span class="section-number-2">17</span> Subset Selection <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-17">
<ul>
<li>Two many attributes?
</li>
<li><b>Ignore some</b>
</li>
<li>Tricky part: which to ignore?
</li>
<li>height x width = area
</li>
</ul>
</div>
<div id="outline-container-17-1" class="outline-3">
<h3 id="sec-17-1"><span class="section-number-3">17.1</span> Simple to Sophisticated <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-17-1">
<ul>
<li>Ignore the ones that are not helpful
</li>
<li>Ignore an attribute highly correlated with another (cm, in)
</li>
<li>Ignore an attribute that can be built from others
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-18" class="outline-2">
<h2 id="sec-18"><span class="section-number-2">18</span> Principal Component Analysis <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-18">
<p><img src="img/GaussianScatterPCA.png" alt="img/GaussianScatterPCA.png" />
</p><ul>
<li>Map data to a locatoin along a few vectors
</li>
</ul>
</div>
<div id="outline-container-18-1" class="outline-3">
<h3 id="sec-18-1"><span class="section-number-3">18.1</span> Higher dimensions <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-18-1">
<ul>
<li>Remember, 2 dimensions might not make much sense, but becomes useful in
higher number of dimensions
</li>
<li>These points described by two attributes, <x,y>
</li>
<li>What if we wanted to describe them in just 1 dimension?
</li>
<li>Pick some good vectors (in our case 1)
</li>
<li>Describe where a point is located using only those vectors
</li>
</ul>
</div>
</div>
</div>
<div id="outline-container-19" class="outline-2">
<h2 id="sec-19"><span class="section-number-2">19</span> Netflix and PCA <span class="tag"><span class="slide">slide</span></span></h2>
<div class="outline-text-2" id="text-19">
<ul>
<li>A user may have many preferences: Mission Impossible, Love Actually, Man
from Nowhere, …
</li>
<li>Instead of keeping track of every preference, we can summarize
</li>
<li>Action, RomCom, Foreign
</li>
</ul>
</div>
<div id="outline-container-19-1" class="outline-3">
<h3 id="sec-19-1"><span class="section-number-3">19.1</span> Summarize in discovered dimensions <span class="tag"><span class="notes">notes</span></span></h3>
<div class="outline-text-3" id="text-19-1">
<ul>
<li>With 3 or more "categories", we can reconstruct the user's likely
preferences
</li>
<li>Dimensions don't necessarily fit into human notions: probably is not an
"foreign" dimension, but a subtle combination of other aspects
</li>
</ul>
<script type="text/javascript" src="production/org-html-slideshow.js"></script>
</div>
</div>
</div>
</div>
<div id="postamble">
<p class="date">Date: 2013-02-08 13:49:51 PST</p>
<p class="author">Author: Jim Blomo</p>
<p class="creator">Org version 7.8.02 with Emacs version 23</p>
<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
</div>
</body>
</html>