-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
944 lines (762 loc) · 26.4 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
<!DOCTYPE html>
<html>
<head>
<title>DublinR - Machine Learning 101</title>
<meta charset="utf-8">
<meta name="description" content="DublinR - Machine Learning 101">
<meta name="author" content="Eoin Brazil - https://github.com/braz/DublinR-ML-treesandforests">
<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>DublinR - Machine Learning 101</h1>
<h2>Introduction with Examples</h2>
<p>Eoin Brazil - https://github.com/braz/DublinR-ML-treesandforests<br/></p>
</hgroup>
</slide>
<!-- SLIDES -->
<slide class="" id="slide-1" style="background:;">
<hgroup>
<h2>Machine Learning Techniques in R</h2>
</hgroup>
<article>
<h3>A bit of context around ML</h3>
<h3>How can you interpret their results?</h3>
<h3>A few techniques to improve prediction / reduce over-fitting</h3>
<h3>Kaggle & similar competitions - using ML for fun & profit</h3>
<h3>Nuts & Bolts - 4 data sets and 6 techniques</h3>
<h3>A brief tour of some useful data handling / formatting tools</h3>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Types of Learning</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-1.png" alt="plot of chunk unnamed-chunk-1"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>A bit of context around ML</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-2.png" alt="plot of chunk unnamed-chunk-2"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-3.png" alt="plot of chunk unnamed-chunk-3"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Model Building Process</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-4.png" alt="plot of chunk unnamed-chunk-4"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Model Selection and Model Assessment</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-5.png" alt="plot of chunk unnamed-chunk-5"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Model Choice - Move from Adaptability to Simplicity</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-6.png" alt="plot of chunk unnamed-chunk-6"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Interpreting A Confusion Matrix</h2>
</hgroup>
<article>
<p><img src="figure/confusionmatrixintp.png" alt="plot of chunk confusionmatrixintp"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Interpreting A Confusion Matrix Example</h2>
</hgroup>
<article>
<p><img src="figure/confusionmatrixexample.png" alt="plot of chunk confusionmatrixexample"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Confusion Matrix - Calculations</h2>
</hgroup>
<article>
<p><img src="figure/confusionmatrix102.png" alt="plot of chunk confusionmatrix102"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-11">
<hgroup>
<h2>Interpreting A ROC Plot</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-7.png" alt="plot of chunk unnamed-chunk-7"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li>A point in this plot is better than another if it is to the northwest (TPR higher / FPR lower / or both)</li>
<li>``Conservatives'' - on LHS and near the X-axis - only make positive classification with strong evidence and making few FP errors but low TP rates</li>
<li>``Liberals'' - on upper RHS - make positive classifications with weak evidence so nearly all positives identified however high FP rates</li>
</ul>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>ROC Dangers</h2>
</hgroup>
<article>
<p><img src="figure/rocdangers.png" alt="plot of chunk rocdangers"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-13">
<hgroup>
<h2>Addressing Prediction Error</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-8.png" alt="plot of chunk unnamed-chunk-8"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li>K-fold Cross-Validation (e.g. 10-fold)
<ul>
<li>Allows for averaging the error across the models</li>
</ul></li>
<li>Bootstrapping, draw B random samples with replacement from data set to create B bootstrapped data sets with same size as original. These are used as training sets with the original used as the test set.</li>
<li>Other variations on above:
<ul>
<li>Repeated cross validation</li>
<li>The '.632' bootstrap</li>
</ul></li>
</ul>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Addressing Feature Selection</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-9.png" alt="plot of chunk unnamed-chunk-9"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Kaggle - using ML for fun & profit</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-10.png" alt="plot of chunk unnamed-chunk-10"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Nuts & Bolts - Data sets and Techniques</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-11.png" alt="plot of chunk unnamed-chunk-11"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-12.png" alt="plot of chunk unnamed-chunk-12"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Aside - How does associative analysis work ?</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-13.png" alt="plot of chunk unnamed-chunk-13"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>What are they good for ?</h2>
</hgroup>
<article>
<h3>Marketing Survey Data - Part 1</h3>
<p><img src="figure/unnamed-chunk-14.png" alt="plot of chunk unnamed-chunk-14"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h3>Marketing Survey Data - Part 2</h3>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-15.png" alt="plot of chunk unnamed-chunk-15"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Aside - How do decision trees work ?</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-16.png" alt="plot of chunk unnamed-chunk-16"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-22">
<hgroup>
<h2>What are they good for ?</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<h3>Car Insurance Policy Exposure Management - Part 1</h3>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-17.png" alt="plot of chunk unnamed-chunk-17"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li>Analysing insurance claim details of 67856 policies taken out in 2004 and 2005.</li>
<li>The model maps each record into one of X mutually exclusive terminal nodes or groups.</li>
<li>These groups are represented by their average response, where the node number is treated as the data group.</li>
<li>The binary claim indicator uses 6 variables to determine a probability estimate for each terminal node determine if a insurance policyholder will claim on their policy.</li>
</ul>
</div>
</article>
</slide>
<slide class="" id="slide-23">
<hgroup>
<h3>Car Insurance Policy Exposure Management - Part 2</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-18.png" alt="plot of chunk unnamed-chunk-18"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li>Root node, splits the data set on 'agecat'</li>
<li>Younger drivers to the left (1-8) and older drivers (9-11) to right</li>
<li>N9 splits on basis of vehicle value</li>
<li>N10 <= $28.9k giving 15k records and 5.4% of claims</li>
<li>N11 > $28.9k+ giving 1.9k records and 8.5% of claims</li>
<li>Left Split from Root, N2 splits on vehicle body type, on age (N4), then on vehicle value (N6)</li>
<li>The n value = num of overall population and the y value = probability of claim from a driver in that group</li>
</ul>
</div>
</article>
</slide>
<slide class="" id="slide-24">
<hgroup>
<h2>What are they good for ?</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<h3>Cancer Research Screening - Part 1</h3>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-19.png" alt="plot of chunk unnamed-chunk-19"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li>Hill et al (2007), models how well cells within an image are segmented, 61 vars with 2019 obs (Training = 1009 & Test = 1010).
<ul>
<li>"Impact of image segmentation on high-content screening data quality for SK-BR-3 cells, Andrew A Hill, Peter LaPan, Yizheng Li and Steve Haney, BMC Bioinformatics 2007, 8:340".</li>
<li>b, Well-Segmented (WS)</li>
<li>c, WS (e.g. complete nucleus and cytoplasmic region)</li>
<li>d, Poorly-Segmented (PS)</li>
<li>e, PS (e.g. partial match/es)</li>
</ul></li>
</ul>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Cancer Research Screening Dataset - Part 2</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-20.png" alt="plot of chunk unnamed-chunk-20"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-26">
<hgroup>
<h3>Cancer Research Screening - Part 3</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<h4>"prp(rpartTune$finalModel)"</h4>
<p><img src="figure/unnamed-chunk-21.png" alt="plot of chunk unnamed-chunk-21"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<h4>"fancyRpartPlot(rpartTune$finalModel)"</h4>
<p><img src="figure/unnamed-chunk-22.png" alt="plot of chunk unnamed-chunk-22"> </p>
</div>
</article>
</slide>
<slide class="" id="slide-27">
<hgroup>
<h3>Cancer Research Screening - Part 4</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-23.png" alt="plot of chunk unnamed-chunk-23"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-24.png" alt="plot of chunk unnamed-chunk-24"> </p>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Cancer Research Screening Dataset - Part 5</h2>
</hgroup>
<article>
<p><img src="figure/liftchartcancer.png" alt="plot of chunk liftchartcancer"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-29">
<hgroup>
<h2>What are they good for ?</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<h3>Predicting the Quality of Wine - Part 1</h3>
<div class='left' style='float:left;width:48%'>
<ul>
<li>Cortez et al (2009), models the quality of wines (Vinho Verde), 14 vars with 4898 obs (Training = 5199 & Test = 1298).</li>
<li>"Modeling wine preferences by data mining from physicochemical properties, P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis, Decision Support Systems 2009, 47(4):547-553".
<ul>
<li>Good (quality score is >= 6)</li>
<li>Bad (quality score is < 6)</li>
</ul></li>
</ul>
<pre><code>##
## Bad Good
## 476 822
</code></pre>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-26.png" alt="plot of chunk unnamed-chunk-26"> </p>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Predicting the Quality of Wine - Part 2</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-27.png" alt="plot of chunk unnamed-chunk-27"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-31">
<hgroup>
<h3>Predicting the Quality of Wine - Part 3</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-28.png" alt="plot of chunk unnamed-chunk-28"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-29.png" alt="plot of chunk unnamed-chunk-29"> </p>
</div>
</article>
</slide>
<slide class="" id="slide-32">
<hgroup>
<h3>Predicting the Quality of Wine - Part 4 - Problems with Trees</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<ul>
<li>Deal with irrelevant inputs</li>
<li>No data preprocessing required</li>
<li>Scalable computation (fast to build)</li>
<li>Tolerant with missing values (little loss of accuracy)</li>
<li>Only a few tunable parameters (easy to learn)</li>
<li>Allows for human understandable graphic representation</li>
</ul>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li>Data fragmentation for high-dimensional sparse data set (over-fitting)</li>
<li>Difficult to fit to a trend / piece-wise constant model</li>
<li>Highly influenced by changes to the data set and local optima (deep trees might be questionable as the errors propagate down)</li>
</ul>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Aside - How does a random forest work ?</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-30.png" alt="plot of chunk unnamed-chunk-30"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-34">
<hgroup>
<h3>Predicting the Quality of Wine - Part 5 - Random Forest</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-31.png" alt="plot of chunk unnamed-chunk-31"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-32.png" alt="plot of chunk unnamed-chunk-32"> </p>
</div>
</article>
</slide>
<slide class="" id="slide-35">
<hgroup>
<h3>Predicting the Quality of Wine - Part 6 - Other ML methods</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<ul>
<li> K-nearest neighbors
<ul>
<li>Unsupervised learning / non-target based learning</li>
<li>Distance matrix / cluster analysis using Euclidean distances.</li>
</ul></li>
<li>Neural Nets
<ul>
<li>Looking at basic feed forward simple 3-layer network (input, 'processing', output)</li>
<li>Each node / neuron is a set of numerical parameters / weights tuned by the learning algorithm used</li>
</ul></li>
</ul>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li>Support Vector Machines
<ul>
<li>Supervised learning</li>
<li>non-probabilistic binary linear classifier / nonlinear classifiers by applying the kernel trick</li>
<li>constructs a hyper-plane/s in a high-dimensional space</li>
</ul></li>
</ul>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Aside - How does k nearest neighbors work ?</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-33.png" alt="plot of chunk unnamed-chunk-33"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-37">
<hgroup>
<h3>Predicting the Quality of Wine - Part 7 - kNN</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-34.png" alt="plot of chunk unnamed-chunk-34"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-35.png" alt="plot of chunk unnamed-chunk-35"> </p>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Aside - How do neural networks work ?</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-36.png" alt="plot of chunk unnamed-chunk-36"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-39">
<hgroup>
<h3>Predicting the Quality of Wine - Part 8 - NNET</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-37.png" alt="plot of chunk unnamed-chunk-37"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-38.png" alt="plot of chunk unnamed-chunk-38"> </p>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Aside - How do support vector machines work ?</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-39.png" alt="plot of chunk unnamed-chunk-39"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-41">
<hgroup>
<h3>Predicting the Quality of Wine - Part 9 - SVN</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-40.png" alt="plot of chunk unnamed-chunk-40"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-41.png" alt="plot of chunk unnamed-chunk-41"> </p>
</div>
</article>
</slide>
<slide class="" id="slide-42">
<hgroup>
<h3>Predicting the Quality of Wine - Part 10 - All Results</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-42.png" alt="plot of chunk unnamed-chunk-42"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-43.png" alt="plot of chunk unnamed-chunk-43"> </p>
</div>
</article>
</slide>
<slide class="" id="slide-43">
<hgroup>
<h2>What are they not good for ?</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<h3>Predicting the Extramarital Affairs</h3>
<div class='left' style='float:left;width:48%'>
<ul>
<li>Fair, R.C. et al (1978), models the possibility of affairs, 9 vars with 601 obs (Training = 481 & Test = 120).</li>
<li>"A Theory of Extramarital Affairs, Fair, R.C., Journal of Political Economy 1978, 86:45-61".
<ul>
<li>Yes (affairs is >= 1 in last 6 months)</li>
<li>No (affairs is < 1 in last 6 months)</li>
</ul></li>
</ul>
<pre><code>##
## No Yes
## 90 30
</code></pre>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-45.png" alt="plot of chunk unnamed-chunk-45"> </p>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>Extramarital Dataset</h2>
</hgroup>
<article>
<p><img src="figure/unnamed-chunk-46.png" alt="plot of chunk unnamed-chunk-46"> </p>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="" id="slide-45">
<hgroup>
<h3>Predicting the Extramarital Affairs - RF & NB</h3>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<h3>Random Forest</h3>
<pre><code>## Reference
## Prediction No Yes
## No 90 30
## Yes 0 0
</code></pre>
<pre><code>## Accuracy
## 0.75
</code></pre>
</div>
<div class='right' style='float:right;width:48%'>
<h3>Naive Bayes</h3>
<pre><code>## Reference
## Prediction No Yes
## No 88 29
## Yes 2 1
</code></pre>
<pre><code>## Accuracy
## 0.75
</code></pre>
</div>
</article>
</slide>
<slide class="" id="slide-46">
<hgroup>
<h2>Other related tools: OpenRefine (formerly Google Refine) / Rattle</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<p><img src="figure/unnamed-chunk-50.png" alt="plot of chunk unnamed-chunk-50"> </p>
</div>
<div class='right' style='float:right;width:48%'>
<p><img src="figure/unnamed-chunk-51.png" alt="plot of chunk unnamed-chunk-51"> </p>
</div>
</article>
</slide>
<slide class="" id="slide-47">
<hgroup>
<h2>Other related tools: Command Line Utilities</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<ul>
<li><a href="http://www.gregreda.com/2013/07/15/unix-commands-for-data-science/">http://www.gregreda.com/2013/07/15/unix-commands-for-data-science/</a>
<ul>
<li>sed / awk</li>
<li>head / tail</li>
<li>wc (word count)</li>
<li>grep</li>
<li>sort / uniq</li>
</ul></li>
<li><a href="http://blog.comsysto.com/2013/04/25/data-analysis-with-the-unix-shell/">http://blog.comsysto.com/2013/04/25/data-analysis-with-the-unix-shell/</a>
<ul>
<li>join</li>
<li>Gnuplot</li>
</ul></li>
</ul>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li><a href="http://jeroenjanssens.com/2013/09/19/seven-command-line-tools-for-data-science.html">http://jeroenjanssens.com/2013/09/19/seven-command-line-tools-for-data-science.html</a>
<ul>
<li><a href="csvkit">http://csvkit.readthedocs.org/en/latest/</a></li>
<li><a href="json2csv">https://github.com/jehiah/json2csv</a></li>
<li><a href="jq%20-%20sed%20for%20json">http://stedolan.github.io/jq/</a></li>
<li><a href="sample">https://github.com/jeroenjanssens/data-science-toolbox/blob/master/sample</a></li>
<li><a href="bitly%20command%20line%20tools">https://github.com/bitly/data_hacks</a></li>
<li><a href="Rio%20-%20csv%20to%20r%20to%20graphic%20output">https://github.com/jeroenjanssens/data-science-toolbox/blob/master/Rio</a></li>
<li><a href="xml2json">https://github.com/parmentf/xml2json</a></li>
</ul></li>
</ul>
</div>
</article>
</slide>
<slide class="" id="slide-48">
<hgroup>
<h2>A (incomplete) tour of the packages in R</h2>
</hgroup>
<article>
<hr noshade size=4 color='red'>
<div class='left' style='float:left;width:48%'>
<ul>
<li>caret</li>
<li>party</li>
<li>rpart</li>
<li>rpart.plot</li>
<li>AppliedPredictiveModeling</li>
<li>randomForest</li>
<li>corrplot</li>
<li>arules</li>
<li>arulesViz</li>
</ul>
</div>
<div class='right' style='float:right;width:48%'>
<ul>
<li>C50</li>
<li>pROC</li>
<li>corrplot</li>
<li>kernlab</li>
<li>rattle</li>
<li>RColorBrewer</li>
<li>corrgram</li>
<li>ElemStatLearn</li>
<li>car</li>
</ul>
</div>
</article>
</slide>
<slide class="class" id="id" style="background:;">
<hgroup>
<h2>In Summary</h2>
</hgroup>
<article>
<h3>An idea of some of the types of classifiers available in ML.</h3>
<h3>What a confusion matrix and ROC means for a classifier and how to interpret them</h3>
<h3>An idea of how to test a set of techniques and parameters to help you find the best model for your data</h3>
<h3>Slides, Data, Scripts are all on GH:</h3>
<h4><a href="https://github.com/braz/DublinR-ML-treesandforests">https://github.com/braz/DublinR-ML-treesandforests</a></h4>
</article>
<!-- Presenter Notes -->
</slide>
<slide class="backdrop"></slide>
</slides>
<!--[if IE]>
<script
src="http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js">
</script>
<script>CFInstall.check({mode: 'overlay'});</script>
<![endif]-->
</body>
<!-- Grab CDN jQuery, fall back to local if offline -->
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"></script>
<script>window.jQuery || document.write('<script src="libraries/widgets/quiz/js/jquery-1.7.min.js"><\/script>')</script>
<!-- Load Javascripts for Widgets -->
<!-- LOAD HIGHLIGHTER JS FILES -->
<script src="libraries/highlighters/highlight.js/highlight.pack.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<!-- DONE LOADING HIGHLIGHTER JS FILES -->
</html>