SlideShare a Scribd company logo
1 of 71
Machine Learning in Practice Lecture 6 Carolyn Penstein Ros é Language Technologies Institute/ Human-Computer Interaction Institute
Plan for the Day ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
Project Proposal ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Assignment 3 ,[object Object],[object Object]
 
Weka Helpful Hints
Use the visualize tab to view 3-way interactions
Naïve Bayes
Bayes Theorem
Bayes Theorem ,[object Object]
Bayes Theorem ,[object Object],[object Object]
Bayes Theorem ,[object Object],[object Object]
How do we train a model? We need to compute what evidence each  value of every feature gives of each  possible prediction (or how typical it would be for instances of that class) What is P(Outlook = rainy | Class = yes)? Store counts on  (class value, feature value)  pairs How many times is  Outlook = rainy  when class = yes? Likelihood that play = yes  if Outlook = rainy = Count(yes & rainy)/ Count(yes) * Count(yes)/Count(yes or no)
How do we train a model? Now try to compute likelihood play = yes for Outlook =  sunny, Temperature = cool, Humidity = high,  Windy = TRUE
Scaling ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Unknown Values ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Note that unknown values are different from unobserved combinations!!!
How do we train a model? What is the conditional probability  P(Humidity = Low| Play = yes)?
Another Example Model ,[object Object],[object Object],[object Object],[object Object],@attribute ice-cream {chocolate, vanilla, coffee, rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy
Another Example Model ,[object Object],[object Object],[object Object],@attribute ice-cream {chocolate, vanilla, coffee,  rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy What is the likelihood that the answer is yum? P(strawberry|yum) = .25 P(chocolate cake|yum) = .75 .25 * .75 * .66 = .124 What is the likelihood that  The answer is good? P(strawberry|good) = 0 P(chocolate cake|good) = 1 0* 1 * .17 = 0 What is the likelihood that  The answer is ok? P(strawberry|ok) = 0 P(chocolate cake|ok) = 0 0*0 * .17 = 0
Another Example Model ,[object Object],[object Object],[object Object],@attribute ice-cream {chocolate, vanilla, coffee,  rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy What is the likelihood that the answer is yum? P(strawberry|yum) = .25 P(chocolate cake|yum) = .75 .25 * .75 * .66 = .124 What is the likelihood that  The answer is good? P(strawberry|good) = 0 P(chocolate cake|good) = 1 0* 1 * .17 = 0 What is the likelihood that  The answer is ok? P(strawberry|ok) = 0 P(chocolate cake|ok) = 0 0*0 * .17 = 0
Another Example Model ,[object Object],[object Object],@attribute ice-cream {chocolate, vanilla, coffee,  rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy What is the likelihood that the answer is yum? P(vanilla|yum) = 0 P(vanilla cake|yum) = .25 0*.25 * .66= 0 What is the likelihood that  The answer is good? P(vanilla|good) = 1 P(vanilla cake|good) = 0 1*0 * .17= 0 What is the likelihood that  The answer is ok? P(vanilla|ok) = 0 P(vanilla cake|ok) = 1 0* 1 * .17 = 0
Another Example Model ,[object Object],[object Object],@attribute ice-cream {chocolate, vanilla, coffee,  rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy What is the likelihood that the answer is yum? P(vanilla|yum) = 0 P(vanilla cake|yum) = .25 0*.25 * .66= 0 What is the likelihood that  The answer is good? P(vanilla|good) = 1 P(vanilla cake|good) = 0 1*0 * .17= 0 What is the likelihood that  The answer is ok? P(vanilla|ok) = 0 P(vanilla cake|ok) = 1 0* 1 * .17 = 0
Statistical Modeling with Small Datasets ,[object Object],[object Object],[object Object],[object Object]
Smoothing ,[object Object],[object Object],[object Object]
Naïve Bayes with smoothing @attribute ice-cream {chocolate, vanilla, coffee,  rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy What is the likelihood that the answer is yum? P(vanilla|yum) = .11 P(vanilla cake|yum) = .33 .11*.33* .66= .03 What is the likelihood that  The answer is good? P(vanilla|good) = .33 P(vanilla cake|good) = .33 .33 * .33 * .17 = .02 What is the likelihood that  The answer is ok? P(vanilla|ok) = .17 P(vanilla cake|ok) = .66 .17 * .66  * .17 = .02
Naïve Bayes with smoothing @attribute ice-cream {chocolate, vanilla, coffee,  rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy What is the likelihood that the answer is yum? P(vanilla|yum) = .11 P(vanilla cake|yum) = .33 .11*.33* .66= .03 What is the likelihood that  The answer is good? P(vanilla|good) = .33 P(vanilla cake|good) = .33 .33 * .33 * .17 = .02 What is the likelihood that  The answer is ok? P(vanilla|ok) = .17 P(vanilla cake|ok) = .66 .17 * .66  * .17 = .02
Numeric Values ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example ,[object Object],[object Object],[object Object],[object Object],[object Object]
Does this hold for text?
Multinomial Naïve Bayes Multiply this by the prior probability of H to get the likelihood, just like with Naïve Bayes.
Does it matter?
Scenario Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
Scenario Each  problem may be associated with more than one  skill Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
Scenario Each  skill may be associated with more than one  problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
How to address the problem? ,[object Object]
How to address the problem? ,[object Object],[object Object],[object Object]
How to address the problem? ,[object Object],[object Object],[object Object],[object Object]
How to address the problem? ,[object Object],[object Object],[object Object],[object Object],[object Object]
How to address the problem? ,[object Object]
Low resolution gives more information if the accuracy is higher Remember this discussion from lecture 2?
Which of these approaches is better? ,[object Object],[object Object],[object Object]
Approach 1 Each  skill corresponds to a separate binary predictor. Each of 91 binary predictors is applied to each text 91 separate predictions are made for each text. Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
Approach 2 Each  skill corresponds to a separate Class value. A single multi- class predictor is applied to each text Only 1 prediction is made for each text. Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
Which of these approaches is better? ,[object Object],[object Object],[object Object],More power, but more opportunity for error
Which of these approaches is better? ,[object Object],[object Object],[object Object],Less power, but fewer opportunities  for error
Approach 1: One versus all ,[object Object],[object Object],[object Object],[object Object],[object Object]
Counts Without Smoothing ,[object Object],[object Object],[object Object],[object Object],Skill5 Majority Class WordX WordY 3 4
Counts With Smoothing ,[object Object],[object Object],[object Object],[object Object],Skill5 Majority Class WordX WordY 4 5
Approach 1 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Approach 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Counts Without Smoothing ,[object Object],[object Object],[object Object],Skill5 Majority Class WordX WordY 3 4 1 13
Counts With Smoothing ,[object Object],[object Object],[object Object],Skill5 Majority Class WordX WordY 4 5 2 14
Approach 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Approach 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Linear Models
Remember this:  What do concepts look like?
Remember this:  What do concepts look like?
Review: Concepts as Lines R B S T C X X X X X X
Review: Concepts as Lines R B S T C X X X X X X
Review: Concepts as Lines R B S T C X X X X X X
Review: Concepts as Lines R B S T C X X X X X X
Review: Concepts as Lines X What will be the prediction for this new data point? R B S T C X X X X X X
What are we learning? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Taking a Step Back ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Performing well with skewed class distributions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Skewed but clean separation
Skewed but clean separation
Skewed but  no  clean separation
Skewed but  no  clean separation
Taking a Step Back ,[object Object],[object Object],[object Object],[object Object],[object Object]

More Related Content

Viewers also liked

Environmental itinerary
Environmental itineraryEnvironmental itinerary
Environmental itineraryAnna Di Tonno
 
Entelektual Sermaye Yonetimi - Insan Kaynaklari Zirvesi 2011
Entelektual Sermaye Yonetimi - Insan Kaynaklari Zirvesi 2011Entelektual Sermaye Yonetimi - Insan Kaynaklari Zirvesi 2011
Entelektual Sermaye Yonetimi - Insan Kaynaklari Zirvesi 2011egitimteknolojileri
 
Vivante-Pitagora presentation for comenius project Tourist_tic
Vivante-Pitagora presentation for comenius project Tourist_ticVivante-Pitagora presentation for comenius project Tourist_tic
Vivante-Pitagora presentation for comenius project Tourist_ticAnna Di Tonno
 
Environmental itinerary
Environmental itineraryEnvironmental itinerary
Environmental itineraryAnna Di Tonno
 
Festa delle eccellenze
Festa delle eccellenzeFesta delle eccellenze
Festa delle eccellenzeAnna Di Tonno
 
Presentazione angiulli rifatta
Presentazione  angiulli rifattaPresentazione  angiulli rifatta
Presentazione angiulli rifattaAnna Di Tonno
 
Entrepreneur Opportunities
Entrepreneur OpportunitiesEntrepreneur Opportunities
Entrepreneur OpportunitiesAnkit Khanna
 
Environmental itinerary
Environmental itineraryEnvironmental itinerary
Environmental itineraryAnna Di Tonno
 
Corso di birdwatching
Corso di birdwatchingCorso di birdwatching
Corso di birdwatchingAnna Di Tonno
 
Rookies Guide To Finding a Job By Girish Mahadevan
Rookies Guide To Finding a Job By Girish MahadevanRookies Guide To Finding a Job By Girish Mahadevan
Rookies Guide To Finding a Job By Girish MahadevanGirish Mahadevan
 

Viewers also liked (12)

Environmental itinerary
Environmental itineraryEnvironmental itinerary
Environmental itinerary
 
Entelektual Sermaye Yonetimi - Insan Kaynaklari Zirvesi 2011
Entelektual Sermaye Yonetimi - Insan Kaynaklari Zirvesi 2011Entelektual Sermaye Yonetimi - Insan Kaynaklari Zirvesi 2011
Entelektual Sermaye Yonetimi - Insan Kaynaklari Zirvesi 2011
 
Eosp fall 2010
Eosp fall 2010Eosp fall 2010
Eosp fall 2010
 
Vivante-Pitagora presentation for comenius project Tourist_tic
Vivante-Pitagora presentation for comenius project Tourist_ticVivante-Pitagora presentation for comenius project Tourist_tic
Vivante-Pitagora presentation for comenius project Tourist_tic
 
Environmental itinerary
Environmental itineraryEnvironmental itinerary
Environmental itinerary
 
Festa delle eccellenze
Festa delle eccellenzeFesta delle eccellenze
Festa delle eccellenze
 
Storia del centro 2
Storia del centro 2Storia del centro 2
Storia del centro 2
 
Presentazione angiulli rifatta
Presentazione  angiulli rifattaPresentazione  angiulli rifatta
Presentazione angiulli rifatta
 
Entrepreneur Opportunities
Entrepreneur OpportunitiesEntrepreneur Opportunities
Entrepreneur Opportunities
 
Environmental itinerary
Environmental itineraryEnvironmental itinerary
Environmental itinerary
 
Corso di birdwatching
Corso di birdwatchingCorso di birdwatching
Corso di birdwatching
 
Rookies Guide To Finding a Job By Girish Mahadevan
Rookies Guide To Finding a Job By Girish MahadevanRookies Guide To Finding a Job By Girish Mahadevan
Rookies Guide To Finding a Job By Girish Mahadevan
 

Similar to ML

Supervised learning: Types of Machine Learning
Supervised learning: Types of Machine LearningSupervised learning: Types of Machine Learning
Supervised learning: Types of Machine LearningLibya Thomas
 
Lec12-Probability.ppt
Lec12-Probability.pptLec12-Probability.ppt
Lec12-Probability.pptakashok1v
 
Lec12-Probability.ppt
Lec12-Probability.pptLec12-Probability.ppt
Lec12-Probability.pptssuserc7c104
 
Notes_5.2.pptx
Notes_5.2.pptxNotes_5.2.pptx
Notes_5.2.pptxjaywarven1
 
Notes_5.2 (1).pptx
Notes_5.2 (1).pptxNotes_5.2 (1).pptx
Notes_5.2 (1).pptxjaywarven1
 
Notes_5.2 (1).pptx
Notes_5.2 (1).pptxNotes_5.2 (1).pptx
Notes_5.2 (1).pptxjaywarven1
 
presentation-111004200224-phpapp02.pptx
presentation-111004200224-phpapp02.pptxpresentation-111004200224-phpapp02.pptx
presentation-111004200224-phpapp02.pptxJennilynBalusdan3
 
An introduction to Bayesian Statistics using Python
An introduction to Bayesian Statistics using PythonAn introduction to Bayesian Statistics using Python
An introduction to Bayesian Statistics using Pythonfreshdatabos
 
powerpoints probability.pptx
powerpoints probability.pptxpowerpoints probability.pptx
powerpoints probability.pptxcarrie mixto
 
NB classifier to use your next exam aslo
NB classifier to use your next exam asloNB classifier to use your next exam aslo
NB classifier to use your next exam aslokuntalpatra420
 
NB classifier_Detailed pdf you can use it
NB classifier_Detailed pdf you can use itNB classifier_Detailed pdf you can use it
NB classifier_Detailed pdf you can use itkuntalpatra420
 

Similar to ML (20)

Supervised learning: Types of Machine Learning
Supervised learning: Types of Machine LearningSupervised learning: Types of Machine Learning
Supervised learning: Types of Machine Learning
 
naive bayes example.pdf
naive bayes example.pdfnaive bayes example.pdf
naive bayes example.pdf
 
naive bayes example.pdf
naive bayes example.pdfnaive bayes example.pdf
naive bayes example.pdf
 
sample space formation.pdf
sample space formation.pdfsample space formation.pdf
sample space formation.pdf
 
Lec12-Probability (1).ppt
Lec12-Probability (1).pptLec12-Probability (1).ppt
Lec12-Probability (1).ppt
 
Lec12-Probability.ppt
Lec12-Probability.pptLec12-Probability.ppt
Lec12-Probability.ppt
 
Lec12-Probability.ppt
Lec12-Probability.pptLec12-Probability.ppt
Lec12-Probability.ppt
 
Lec12-Probability.ppt
Lec12-Probability.pptLec12-Probability.ppt
Lec12-Probability.ppt
 
Notes_5.2.pptx
Notes_5.2.pptxNotes_5.2.pptx
Notes_5.2.pptx
 
Notes_5.2 (1).pptx
Notes_5.2 (1).pptxNotes_5.2 (1).pptx
Notes_5.2 (1).pptx
 
Notes_5.2 (1).pptx
Notes_5.2 (1).pptxNotes_5.2 (1).pptx
Notes_5.2 (1).pptx
 
presentation-111004200224-phpapp02.pptx
presentation-111004200224-phpapp02.pptxpresentation-111004200224-phpapp02.pptx
presentation-111004200224-phpapp02.pptx
 
An introduction to Bayesian Statistics using Python
An introduction to Bayesian Statistics using PythonAn introduction to Bayesian Statistics using Python
An introduction to Bayesian Statistics using Python
 
Lab4 2022
Lab4 2022Lab4 2022
Lab4 2022
 
powerpoints probability.pptx
powerpoints probability.pptxpowerpoints probability.pptx
powerpoints probability.pptx
 
Naive Bayes Presentation
Naive Bayes PresentationNaive Bayes Presentation
Naive Bayes Presentation
 
NB classifier to use your next exam aslo
NB classifier to use your next exam asloNB classifier to use your next exam aslo
NB classifier to use your next exam aslo
 
NB classifier_Detailed pdf you can use it
NB classifier_Detailed pdf you can use itNB classifier_Detailed pdf you can use it
NB classifier_Detailed pdf you can use it
 
NaiveBayes.ppt
NaiveBayes.pptNaiveBayes.ppt
NaiveBayes.ppt
 
NaiveBayes.ppt
NaiveBayes.pptNaiveBayes.ppt
NaiveBayes.ppt
 

Recently uploaded

Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 

Recently uploaded (20)

Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 

ML

  • 1. Machine Learning in Practice Lecture 6 Carolyn Penstein Ros é Language Technologies Institute/ Human-Computer Interaction Institute
  • 2.
  • 3.  
  • 4.
  • 5.
  • 6.  
  • 8. Use the visualize tab to view 3-way interactions
  • 11.
  • 12.
  • 13.
  • 14. How do we train a model? We need to compute what evidence each value of every feature gives of each possible prediction (or how typical it would be for instances of that class) What is P(Outlook = rainy | Class = yes)? Store counts on (class value, feature value) pairs How many times is Outlook = rainy when class = yes? Likelihood that play = yes if Outlook = rainy = Count(yes & rainy)/ Count(yes) * Count(yes)/Count(yes or no)
  • 15. How do we train a model? Now try to compute likelihood play = yes for Outlook = sunny, Temperature = cool, Humidity = high, Windy = TRUE
  • 16.
  • 17.
  • 18. How do we train a model? What is the conditional probability P(Humidity = Low| Play = yes)?
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Naïve Bayes with smoothing @attribute ice-cream {chocolate, vanilla, coffee, rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy What is the likelihood that the answer is yum? P(vanilla|yum) = .11 P(vanilla cake|yum) = .33 .11*.33* .66= .03 What is the likelihood that The answer is good? P(vanilla|good) = .33 P(vanilla cake|good) = .33 .33 * .33 * .17 = .02 What is the likelihood that The answer is ok? P(vanilla|ok) = .17 P(vanilla cake|ok) = .66 .17 * .66 * .17 = .02
  • 27. Naïve Bayes with smoothing @attribute ice-cream {chocolate, vanilla, coffee, rocky-road, strawberry} @attribute cake {chocolate, vanilla} @attribute yummy {yum,good,ok} @data chocolate,chocolate,yum vanilla,chocolate,good coffee,chocolate,yum coffee,vanilla,ok rocky-road,chocolate,yum strawberry,vanilla,yum @relation is-yummy What is the likelihood that the answer is yum? P(vanilla|yum) = .11 P(vanilla cake|yum) = .33 .11*.33* .66= .03 What is the likelihood that The answer is good? P(vanilla|good) = .33 P(vanilla cake|good) = .33 .33 * .33 * .17 = .02 What is the likelihood that The answer is ok? P(vanilla|ok) = .17 P(vanilla cake|ok) = .66 .17 * .66 * .17 = .02
  • 28.
  • 29.
  • 30. Does this hold for text?
  • 31. Multinomial Naïve Bayes Multiply this by the prior probability of H to get the likelihood, just like with Naïve Bayes.
  • 33. Scenario Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
  • 34. Scenario Each problem may be associated with more than one skill Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
  • 35. Scenario Each skill may be associated with more than one problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41. Low resolution gives more information if the accuracy is higher Remember this discussion from lecture 2?
  • 42.
  • 43. Approach 1 Each skill corresponds to a separate binary predictor. Each of 91 binary predictors is applied to each text 91 separate predictions are made for each text. Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
  • 44. Approach 2 Each skill corresponds to a separate Class value. A single multi- class predictor is applied to each text Only 1 prediction is made for each text. Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math story problem Math Skill 1 Math Skill 2 Math Skill 3 Math Skill 4 Math Skill 5 Math Skill 6 Math Skill 7 Math Skill 8 Math Skill 9 Math Skill10 Math Skill11 Math Skill12 Math Skill13 Math Skill14
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 57. Remember this: What do concepts look like?
  • 58. Remember this: What do concepts look like?
  • 59. Review: Concepts as Lines R B S T C X X X X X X
  • 60. Review: Concepts as Lines R B S T C X X X X X X
  • 61. Review: Concepts as Lines R B S T C X X X X X X
  • 62. Review: Concepts as Lines R B S T C X X X X X X
  • 63. Review: Concepts as Lines X What will be the prediction for this new data point? R B S T C X X X X X X
  • 64.
  • 65.
  • 66.
  • 67. Skewed but clean separation
  • 68. Skewed but clean separation
  • 69. Skewed but no clean separation
  • 70. Skewed but no clean separation
  • 71.