SlideShare a Scribd company logo
1 of 58
CS 221: Artificial Intelligence Lecture 5: Machine Learning Peter Norvig and Sebastian Thrun
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Machine Learning ,[object Object],[object Object],[object Object],[object Object],[object Object]
Machine Learning Lingo What? Parameters Structure Hidden concepts What from? Supervised Unsupervised Reinforcement Self-supervised What for? Prediction Diagnosis Compression Discovery How? Passive Active Online Offline Output? Classification Regression Clustering Details?? Generative Discriminative Smoothing
Supervised Machine Learning Given a training set: ( x 1 , y 1 ),  ( x 2 , y 2 ),  ( x 3 , y 3 ),  …   ( x n , y n ) Where each  y i   was generated by an unknown  y = f  ( x ), Discover a function  h  that approximates the true function  f.
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Classification Example: Spam Filter ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Dear Sir. First, I must solicit your confidence in this transaction, this is by virture of its nature as being utterly confidencial and top secret. … TO BE REMOVED FROM FUTURE MAILINGS, SIMPLY REPLY TO THIS MESSAGE AND PUT "REMOVE" IN THE SUBJECT. 99  MILLION EMAIL ADDRESSES FOR ONLY $99 Ok, Iknow this is blatantly OT but I'm beginning to go insane. Had an old Dell Dimension XPS sitting in the corner and decided to put it to use, I know it was working pre being stuck in the corner, but when I plugged it in, hit the power nothing happened.
A Spam Filter ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Dear Sir. First, I must solicit your confidence in this transaction, this is by virture of its nature as being utterly confidencial and top secret. … TO BE REMOVED FROM FUTURE MAILINGS, SIMPLY REPLY TO THIS MESSAGE AND PUT "REMOVE" IN THE SUBJECT. 99  MILLION EMAIL ADDRESSES FOR ONLY $99 Ok, Iknow this is blatantly OT but I'm beginning to go insane. Had an old Dell Dimension XPS sitting in the corner and decided to put it to use, I know it was working pre being stuck in the corner, but when I plugged it in, hit the power nothing happened.
Naïve Bayes for Text ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Word at position i, not i th  word in the dictionary!
General Naïve Bayes ,[object Object],[object Object],[object Object],[object Object],Y F 1 F n F 2 |Y| parameters n x |F| x |Y| parameters |Y| x |F| n  parameters
Example: Spam Filtering ,[object Object],[object Object],[object Object],the :  0.0156 to  :  0.0153 and :  0.0115 of  :  0.0095 you :  0.0093 a  :  0.0086 with:  0.0080 from:  0.0075 ... the :  0.0210 to  :  0.0133 of  :  0.0119 2002:  0.0110 with:  0.0108 from:  0.0107 and :  0.0105 a  :  0.0100 ... ham : 0.66 spam: 0.33 Counts from examples!
Spam Example P(spam | words) = e -76  / (e -76  + e -80.5 ) = 98.9% Word P(w|spam) P(w|ham) Tot Spam Tot Ham (prior) 0.33333 0.66666 -1.1 -0.4 Gary 0.00002 0.00021 -11.8 -8.9 would 0.00069 0.00084 -19.1 -16.0 you 0.00881 0.00304 -23.8 -21.8 like 0.00086 0.00083 -30.9 -28.9 to 0.01517 0.01339 -35.1 -33.2 lose 0.00008 0.00002 -44.5 -44.0 weight 0.00016 0.00002 -53.3 -55.0 while 0.00027 0.00027 -61.5 -63.2 you 0.00881 0.00304 -66.2 -69.0 sleep 0.00006 0.00001 -76.0 -80.5
Example: Overfitting ,[object Object],south-west : inf nation  : inf morally  : inf nicely  : inf extent  : inf seriously  : inf ... What went wrong here? screens  : inf minute  : inf guaranteed : inf $205.00  : inf delivery  : inf signature  : inf ...
Generalization and Overfitting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Estimation: Smoothing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],r g g
Estimation: Laplace Smoothing ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],H H T
Estimation: Linear Interpolation  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Real NB: Smoothing ,[object Object],[object Object],helvetica : 11.4 seems  : 10.8 group  : 10.2 ago  :  8.4 areas  :  8.3 ... verdana : 28.8 Credit  : 28.4 ORDER  : 27.2 <FONT>  : 26.9 money  : 26.5 ... Do these make more sense?
Tuning on Held-Out Data ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
How to Learn ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Training Data Held-Out Data Test Data
What to Do About Errors? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Digit Recognizer ,[object Object],[object Object]
Example: Digit Recognition ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],0 1 2 1 ??
Naïve Bayes for Digits ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Learning Model Parameters 1 0.1 2 0.1 3 0.1 4 0.1 5 0.1 6 0.1 7 0.1 8 0.1 9 0.1 0 0.1 1 0.01 2 0.05 3 0.05 4 0.30 5 0.80 6 0.90 7 0.05 8 0.60 9 0.50 0 0.80 1 0.05 2 0.01 3 0.90 4 0.80 5 0.90 6 0.90 7 0.25 8 0.85 9 0.60 0 0.80
Problem: Overfitting 2 wins!!
 
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Regression ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Regression: Minimizing Loss ,[object Object],[object Object]
Regression: Minimizing Loss
Regression: Minimizing Loss Choose weights to minimize sum of squared errors
Regression: Minimizing Loss
Regression: Minimizing Loss y  =  w 1   x  +  w 0 Linear algebra gives an exact solution to the minimization problem
Linear Algebra Solution
Don ’t Always Trust Linear Models
Regression by Gradient Descent w  =  any point   loop until convergence do: for each  w i  in  w  do: w i  = w i  – α  ∂  Loss ( w ) ∂  w i
Multivariate Regression ,[object Object],[object Object],[object Object],[object Object]
Overfitting ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Regularization and Sparsity L 1   regularization L 2   regularization ,[object Object]
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Linear Separator
Perceptron
Perceptron Algorithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What Linear Separator to Pick?
What Linear Separator to Pick? Maximizes the “margin” Support Vector Machines
Non-Separable Data? ,[object Object],[object Object],[object Object],[object Object],X 1 X 2 X 3
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Nonparametric Models ,[object Object]
Nearest-Neighbor Classification ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Earthquakes and Explosions Using logistic regression (similar to linear regression) to do linear classification
K =1 Nearest Neighbors Using nearest neighbors to do classification
K =5 Nearest Neighbors Even with no parameters, you still have hyperparameters!
Curse of Dimensionality Average neighborhood size for 10-nearest neighbors,  n  dimensions, 1M uniform points
Curse of Dimensionality Proportion of points that are within the outer shell, 1% of thickness of the hypercube
Outline ,[object Object],[object Object],[object Object],[object Object],[object Object]
Machine Learning Lingo What? Parameters Structure Hidden concepts What from? Supervised Unsupervised Reinforcement Self-supervised What for? Prediction Diagnosis Compression Discovery How? Passive Active Online Offline Output? Classification Regression Clustering Details?? Generative Discriminative Smoothing

More Related Content

Viewers also liked

Supervised Learning
Supervised LearningSupervised Learning
Supervised Learning
butest
 
Hadoop and Enterprise Data Warehouse
Hadoop and Enterprise Data WarehouseHadoop and Enterprise Data Warehouse
Hadoop and Enterprise Data Warehouse
DataWorks Summit
 
Taking Pnb To The Next Level
Taking Pnb To The Next LevelTaking Pnb To The Next Level
Taking Pnb To The Next Level
tiwari1989
 
BioengineeredTumorModel_DrJonasMoses_r2015
BioengineeredTumorModel_DrJonasMoses_r2015BioengineeredTumorModel_DrJonasMoses_r2015
BioengineeredTumorModel_DrJonasMoses_r2015
Dr. Jonas Moses
 
凱絡媒體週報 2011 11 25
凱絡媒體週報 2011 11 25凱絡媒體週報 2011 11 25
凱絡媒體週報 2011 11 25
Eson Chih
 
Marketing artikel factomagazine 1107 en 1108 (white space conflict)
Marketing artikel factomagazine 1107 en 1108 (white space conflict)Marketing artikel factomagazine 1107 en 1108 (white space conflict)
Marketing artikel factomagazine 1107 en 1108 (white space conflict)
Mobiliteitsscan.com
 
Kennis rapportage blauw research_hnw_doe_je_zelf
Kennis rapportage blauw research_hnw_doe_je_zelfKennis rapportage blauw research_hnw_doe_je_zelf
Kennis rapportage blauw research_hnw_doe_je_zelf
Mobiliteitsscan.com
 
Cs221 lecture7-fall11
Cs221 lecture7-fall11Cs221 lecture7-fall11
Cs221 lecture7-fall11
darwinrlo
 

Viewers also liked (20)

Tweets Classification using Naive Bayes and SVM
Tweets Classification using Naive Bayes and SVMTweets Classification using Naive Bayes and SVM
Tweets Classification using Naive Bayes and SVM
 
Supervised Learning
Supervised LearningSupervised Learning
Supervised Learning
 
Presentation on supervised learning
Presentation on supervised learningPresentation on supervised learning
Presentation on supervised learning
 
A Reference Architecture for ETL 2.0
A Reference Architecture for ETL 2.0 A Reference Architecture for ETL 2.0
A Reference Architecture for ETL 2.0
 
Hadoop and Enterprise Data Warehouse
Hadoop and Enterprise Data WarehouseHadoop and Enterprise Data Warehouse
Hadoop and Enterprise Data Warehouse
 
Taking Pnb To The Next Level
Taking Pnb To The Next LevelTaking Pnb To The Next Level
Taking Pnb To The Next Level
 
Aemas newsletter december 2011 vol. 1 issue no. 2
Aemas newsletter december 2011 vol. 1 issue no. 2Aemas newsletter december 2011 vol. 1 issue no. 2
Aemas newsletter december 2011 vol. 1 issue no. 2
 
BioengineeredTumorModel_DrJonasMoses_r2015
BioengineeredTumorModel_DrJonasMoses_r2015BioengineeredTumorModel_DrJonasMoses_r2015
BioengineeredTumorModel_DrJonasMoses_r2015
 
Presentation2
Presentation2Presentation2
Presentation2
 
凱絡媒體週報 2011 11 25
凱絡媒體週報 2011 11 25凱絡媒體週報 2011 11 25
凱絡媒體週報 2011 11 25
 
The daily mail
The daily mailThe daily mail
The daily mail
 
Alm alloy
Alm alloyAlm alloy
Alm alloy
 
Marketing artikel factomagazine 1107 en 1108 (white space conflict)
Marketing artikel factomagazine 1107 en 1108 (white space conflict)Marketing artikel factomagazine 1107 en 1108 (white space conflict)
Marketing artikel factomagazine 1107 en 1108 (white space conflict)
 
Treball 11111
Treball 11111Treball 11111
Treball 11111
 
Ren21 general
Ren21 generalRen21 general
Ren21 general
 
Wil Group, Development Solutions in Africa
Wil Group, Development Solutions in AfricaWil Group, Development Solutions in Africa
Wil Group, Development Solutions in Africa
 
Kennis rapportage blauw research_hnw_doe_je_zelf
Kennis rapportage blauw research_hnw_doe_je_zelfKennis rapportage blauw research_hnw_doe_je_zelf
Kennis rapportage blauw research_hnw_doe_je_zelf
 
Cs221 lecture7-fall11
Cs221 lecture7-fall11Cs221 lecture7-fall11
Cs221 lecture7-fall11
 
 
Onderwijs in de steigers in Mago
Onderwijs in de steigers in MagoOnderwijs in de steigers in Mago
Onderwijs in de steigers in Mago
 

Similar to Cs221 lecture5-fall11

Computational Biology, Part 4 Protein Coding Regions
Computational Biology, Part 4 Protein Coding RegionsComputational Biology, Part 4 Protein Coding Regions
Computational Biology, Part 4 Protein Coding Regions
butest
 
An Introduction to boosting
An Introduction to boostingAn Introduction to boosting
An Introduction to boosting
butest
 
Using binary classifiers
Using binary classifiersUsing binary classifiers
Using binary classifiers
butest
 

Similar to Cs221 lecture5-fall11 (20)

Supervised learning: Types of Machine Learning
Supervised learning: Types of Machine LearningSupervised learning: Types of Machine Learning
Supervised learning: Types of Machine Learning
 
Computational Biology, Part 4 Protein Coding Regions
Computational Biology, Part 4 Protein Coding RegionsComputational Biology, Part 4 Protein Coding Regions
Computational Biology, Part 4 Protein Coding Regions
 
Machine learning and_nlp
Machine learning and_nlpMachine learning and_nlp
Machine learning and_nlp
 
NaiveBayes.ppt
NaiveBayes.pptNaiveBayes.ppt
NaiveBayes.ppt
 
NaiveBayes.ppt
NaiveBayes.pptNaiveBayes.ppt
NaiveBayes.ppt
 
NaiveBayes.ppt
NaiveBayes.pptNaiveBayes.ppt
NaiveBayes.ppt
 
Classification
ClassificationClassification
Classification
 
An Introduction to boosting
An Introduction to boostingAn Introduction to boosting
An Introduction to boosting
 
Explainable AI
Explainable AIExplainable AI
Explainable AI
 
Data simulation basics
Data simulation basicsData simulation basics
Data simulation basics
 
Using binary classifiers
Using binary classifiersUsing binary classifiers
Using binary classifiers
 
supervised.pptx
supervised.pptxsupervised.pptx
supervised.pptx
 
Anomaly detection Full Article
Anomaly detection Full ArticleAnomaly detection Full Article
Anomaly detection Full Article
 
Explore ml day 2
Explore ml day 2Explore ml day 2
Explore ml day 2
 
4. Classification.pdf
4. Classification.pdf4. Classification.pdf
4. Classification.pdf
 
Supervised algorithms
Supervised algorithmsSupervised algorithms
Supervised algorithms
 
2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datos2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datos
 
M08 BiasVarianceTradeoff
M08 BiasVarianceTradeoffM08 BiasVarianceTradeoff
M08 BiasVarianceTradeoff
 
06-01 Machine Learning and Linear Regression.pptx
06-01 Machine Learning and Linear Regression.pptx06-01 Machine Learning and Linear Regression.pptx
06-01 Machine Learning and Linear Regression.pptx
 
Model Selection and Validation
Model Selection and ValidationModel Selection and Validation
Model Selection and Validation
 

More from darwinrlo

Cs221 probability theory
Cs221 probability theoryCs221 probability theory
Cs221 probability theory
darwinrlo
 
Cs221 logic-planning
Cs221 logic-planningCs221 logic-planning
Cs221 logic-planning
darwinrlo
 
Cs221 linear algebra
Cs221 linear algebraCs221 linear algebra
Cs221 linear algebra
darwinrlo
 
Cs221 lecture8-fall11
Cs221 lecture8-fall11Cs221 lecture8-fall11
Cs221 lecture8-fall11
darwinrlo
 
Cs221 lecture6-fall11
Cs221 lecture6-fall11Cs221 lecture6-fall11
Cs221 lecture6-fall11
darwinrlo
 
Cs221 lecture4-fall11
Cs221 lecture4-fall11Cs221 lecture4-fall11
Cs221 lecture4-fall11
darwinrlo
 
Cs221 lecture3-fall11
Cs221 lecture3-fall11Cs221 lecture3-fall11
Cs221 lecture3-fall11
darwinrlo
 

More from darwinrlo (8)

Cs221 probability theory
Cs221 probability theoryCs221 probability theory
Cs221 probability theory
 
Cs221 logic-planning
Cs221 logic-planningCs221 logic-planning
Cs221 logic-planning
 
Cs221 linear algebra
Cs221 linear algebraCs221 linear algebra
Cs221 linear algebra
 
Cs221 lecture8-fall11
Cs221 lecture8-fall11Cs221 lecture8-fall11
Cs221 lecture8-fall11
 
Cs221 lecture6-fall11
Cs221 lecture6-fall11Cs221 lecture6-fall11
Cs221 lecture6-fall11
 
Cs221 lecture4-fall11
Cs221 lecture4-fall11Cs221 lecture4-fall11
Cs221 lecture4-fall11
 
Cs221 lecture3-fall11
Cs221 lecture3-fall11Cs221 lecture3-fall11
Cs221 lecture3-fall11
 
Cs221 rl
Cs221 rlCs221 rl
Cs221 rl
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Cs221 lecture5-fall11

  • 1. CS 221: Artificial Intelligence Lecture 5: Machine Learning Peter Norvig and Sebastian Thrun
  • 2.
  • 3.
  • 4.
  • 5. Machine Learning Lingo What? Parameters Structure Hidden concepts What from? Supervised Unsupervised Reinforcement Self-supervised What for? Prediction Diagnosis Compression Discovery How? Passive Active Online Offline Output? Classification Regression Clustering Details?? Generative Discriminative Smoothing
  • 6. Supervised Machine Learning Given a training set: ( x 1 , y 1 ), ( x 2 , y 2 ), ( x 3 , y 3 ), … ( x n , y n ) Where each y i was generated by an unknown y = f ( x ), Discover a function h that approximates the true function f.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13. Spam Example P(spam | words) = e -76 / (e -76 + e -80.5 ) = 98.9% Word P(w|spam) P(w|ham) Tot Spam Tot Ham (prior) 0.33333 0.66666 -1.1 -0.4 Gary 0.00002 0.00021 -11.8 -8.9 would 0.00069 0.00084 -19.1 -16.0 you 0.00881 0.00304 -23.8 -21.8 like 0.00086 0.00083 -30.9 -28.9 to 0.01517 0.01339 -35.1 -33.2 lose 0.00008 0.00002 -44.5 -44.0 weight 0.00016 0.00002 -53.3 -55.0 while 0.00027 0.00027 -61.5 -63.2 you 0.00881 0.00304 -66.2 -69.0 sleep 0.00006 0.00001 -76.0 -80.5
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Learning Model Parameters 1 0.1 2 0.1 3 0.1 4 0.1 5 0.1 6 0.1 7 0.1 8 0.1 9 0.1 0 0.1 1 0.01 2 0.05 3 0.05 4 0.30 5 0.80 6 0.90 7 0.05 8 0.60 9 0.50 0 0.80 1 0.05 2 0.01 3 0.90 4 0.80 5 0.90 6 0.90 7 0.25 8 0.85 9 0.60 0 0.80
  • 28.  
  • 29.
  • 30.
  • 31.
  • 33. Regression: Minimizing Loss Choose weights to minimize sum of squared errors
  • 35. Regression: Minimizing Loss y = w 1 x + w 0 Linear algebra gives an exact solution to the minimization problem
  • 37. Don ’t Always Trust Linear Models
  • 38. Regression by Gradient Descent w = any point loop until convergence do: for each w i in w do: w i = w i – α ∂ Loss ( w ) ∂ w i
  • 39.
  • 40.
  • 41.
  • 42.
  • 45.
  • 47. What Linear Separator to Pick? Maximizes the “margin” Support Vector Machines
  • 48.
  • 49.
  • 50.
  • 51.
  • 52. Earthquakes and Explosions Using logistic regression (similar to linear regression) to do linear classification
  • 53. K =1 Nearest Neighbors Using nearest neighbors to do classification
  • 54. K =5 Nearest Neighbors Even with no parameters, you still have hyperparameters!
  • 55. Curse of Dimensionality Average neighborhood size for 10-nearest neighbors, n dimensions, 1M uniform points
  • 56. Curse of Dimensionality Proportion of points that are within the outer shell, 1% of thickness of the hypercube
  • 57.
  • 58. Machine Learning Lingo What? Parameters Structure Hidden concepts What from? Supervised Unsupervised Reinforcement Self-supervised What for? Prediction Diagnosis Compression Discovery How? Passive Active Online Offline Output? Classification Regression Clustering Details?? Generative Discriminative Smoothing