Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining,...
Transcript of Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining,...
![Page 2: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/2.jpg)
Literatura
1.T. Hastie, R. Tishirani, and J. Friedman. The Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další, web).
2.I.H.Witten and E.Frank. Data Mining - Practical machine learning tools and techniques with Java implementation. Accademic Press Pub., USA, 1999.
![Page 3: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/3.jpg)
Doplňující literatura
P. Berka.Dobývání znalostí z databází. Academia, 2003.T. Mitchell. Machine Learning. McGraw Hill, New York, 1997.S. Russel and P. Norwig. Artificial Intelligence: A Modern Approach. Prentice Hall, 2003.
![Page 4: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/4.jpg)
Příklady statistického učení
Vytořit z dat model, který dokáže:● Určit polohu robota z minulé pozice a senzorů .● U pacienta hospitalizovaného s infarktem
predikovat riziko dalšího infarktu. Predikci lze založit na demografických, stravovacích a klinických datech o pacientovi.
● Rozpoznání spamu od e-mailu.● Predikovat cenu akcií za 6 měsíců z aktuální
výkonnosti společnosti a ekonomických dat.
![Page 5: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/5.jpg)
Typický scénář „zadání“● Máme danou cílovou veličinu
● kvantivativní Y – cena akcií, nebo● kategoriální G – infarkt ano/ne.
● Chceme její hodnotu predikovat na základě příznaků (features) X● klinická měření, stravování.
● Máme množinu trénovacích dat, u kterých známe i příznaky, i hodnotu cílové veličiny.
● Na základě těchto dat tvoříme model . ● Dobrý model predikuje cíl s malou chybou.
f , g
![Page 6: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/6.jpg)
Učení s učitelem / bez učitele● Předchozí slajd se týká učení s učitelem
(supervized learning).
● Při učení bez učitele nemáme žádnou cílovou veličinu, úkolem je popsat data – např. klastrováním či určením závislostí. (unsupervised learning)
![Page 7: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/7.jpg)
Příklad: Klasifikace e-mailu.● Data obsahují 4601 příkladů, snažíme se
rozlišit spam a žádaný e-mail.● Známe cílovou třídu spam/email a frekvence 57
nejčastějších slov či znaků.
● Příklad modelu:
● V tomto příkladu je nestejná cena chyby.
![Page 8: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/8.jpg)
Příklad: rakovina prostaty● Cílem je predikovat logaritmus prostate specific
antigen (lpsa) z množiny příznaků.
● Predikujeme spojitouveličinu.
● Bodový graf, XY graf(scatter plot)
![Page 9: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/9.jpg)
ObsahChapter 2: Úvod do učení s učitelemChapter 3. a 4. Lineární metody pro regresi a klasifikaciChapter 5. SplajnyChapter 6. Jádrové (kernal) metody a lokální regrese
Chapter 7. Ohodnocení a volba modelůChapter 8. Kombinace modelů, EM algoritmus, ..Chapter 9: Rozhodovací stromyChapter 10: BoostingChapter 11: Neuronové sítě
Chapter 12: Support vector machinesChapter 13: Nejbližší sousedéChapter 14: Učení bez učitele
![Page 10: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/10.jpg)
Typické otázky u zkoušky● Vysvětlete pojem:
přeučení, prokletí dimenzionality, bayesovsky optimální predikce, maximálně věrohodný odhad, optimální separující nadrovina, ...
● Napište algoritmus: AdaBoost, Rozhodovací stromy včetně prořezávání, EM, SVM, ...
● Dolňující otázky pro ujasnění, nakolik pojmům/algoritmům rozumíte
na jedničku či pokud jste někde hodně nevěděli.Mnohé ze slajdů se nezkouší, z přednášky možná vytušíte co ;-)
![Page 11: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/11.jpg)
Přehled základních pojmů● vstupní veličiny (=features), cílová veličina● numerické, kategoriální, uspořádané veličiny● regrese (=predikce numerické veličiny)● klasifikace (=predikce kategoriální veličiny)● binární veličiny – kódujeme 0/1 nebo -1/1● uspořádané – často pomocí dummy variables (pomocné
proměnné)
● vstupní veličiny značíme X, výstup Y resp. G.● X je matice Nxp, predikce značíme střechou .
![Page 12: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/12.jpg)
Lineární regresep
p
p
p
![Page 13: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/13.jpg)
Lin. regrese 2
p
![Page 14: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/14.jpg)
Lin. regrese - výsledek
● Není-li invertibilní, ubereme závislé sloupce, nebo se pokusíme překódovat nebo přefiltrovat data tak, aby invertibilní byla.
![Page 15: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/15.jpg)
![Page 16: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/16.jpg)
![Page 17: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/17.jpg)
![Page 18: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/18.jpg)
Maskování
U lineární regrese pro víc tříd může dojít k maskování:modrá třída není nikdy predikovaná.
![Page 19: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/19.jpg)
![Page 20: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/20.jpg)
![Page 21: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/21.jpg)
![Page 22: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/22.jpg)
![Page 23: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/23.jpg)
Lin. regrese vs. nejbližší sousedé● Lineární regrese
● je hladká, stabilní● výrazně závisí na předpokladu linearity hranice● má malý rozptyl, potenciálně velké vychýlení (bias).
● k-NN● se přizpůsobí libovolné (spojité..) hranici● predikce záleží na pozici a hodnotách pár okolních
bodů, proto je nestabilní● velký rozptyl, malé vychýlení (bias).
![Page 24: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/24.jpg)
Přeučení (overfitting)● Přeučením se nazývá
přílišná závislost modelu na trénovacích datech, která zvyšuje chybu na testovacích datech.Tj. růst oranžové křivky při klesající modré vpravo v grafu.
![Page 25: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/25.jpg)
Optimální bayeskovská hranice● Pokud víme, jakým
procesem jsou data generována, můžeme v každém bodě predikovat nejčastější hodnotu (při stejné ceně chyby).
● Tento postup vytvoří optimální bayesovskou hranici (kde jsou obě hodnoty stejně časté).
![Page 26: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/26.jpg)
Prokletí dimenzionality● Nejbližší sousedé jsou při velké dimenzi hodně
daleko.
![Page 27: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/27.jpg)
Proč vadí vzdálený nejbližší soused
![Page 28: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/28.jpg)
Druhý příklad
![Page 29: Strojové učeníkti.mff.cuni.cz/~marta/uvod.pdfThe Elements of Statistical Learning, Data Mining, Inference and Prediction. Springer Series in Statistics. Springer, (2003 a další,](https://reader034.fdocuments.in/reader034/viewer/2022042219/5ec54d853de64e38cd093124/html5/thumbnails/29.jpg)
Weka● nástroj pro Data mining, umožňuje učit mnoho
modelů.
● http://www.cs.waikato.ac.nz/ml/weka/