cs 10 problem solving via object oriented programming
play

CS 10: Problem solving via Object Oriented Programming Pattern - PowerPoint PPT Presentation

CS 10: Problem solving via Object Oriented Programming Pattern Recognition Agenda 1. Pattern matching vs. recognition 2. From Finite Automata to Hidden Markov Models 3. Decoding: Viterbi algorithm 4. Training 2 Last class we discussed how


  1. CS 10: Problem solving via Object Oriented Programming Pattern Recognition

  2. Agenda 1. Pattern matching vs. recognition 2. From Finite Automata to Hidden Markov Models 3. Decoding: Viterbi algorithm 4. Training 2

  3. Last class we discussed how to use a Finite Automata to match a pattern Email addresses follow a pattern: mailbox@domain.TLD example: tjp@cs.dartmouth.edu com Start . a-z @ a-z edu a-z a-z org Finite Automata can represent email address pattern Sample addresses can be easily verified if in correct form . The email address pattern must be followed exactly . Any deviation results in rejection . 3

  4. Sometimes our input is noisy and does not exactly match a pattern Pattern matching vs. recognition Matching Recognition Is this a duck? 4 Image: duckrace.com

  5. Sometimes our input is noisy and does not exactly match a pattern Pattern matching vs. recognition Matching Recognition Looks like a duck Is this a duck? 5 Image: duckrace.com

  6. Sometimes our input is noisy and does not exactly match a pattern Pattern matching vs. recognition Matching Recognition Looks like a duck Quacks like a duck Is this a duck? 6 Image: duckrace.com

  7. Sometimes our input is noisy and does not exactly match a pattern Pattern matching vs. recognition Matching Recognition Looks like a duck Quacks like a duck Does not wear cool Is this a duck? eyewear 7 Image: duckrace.com

  8. Sometimes our input is noisy and does not exactly match a pattern Pattern matching vs. recognition Matching Recognition Looks like a duck Quacks like a duck Does not wear cool Is this a duck? eyewear Is it a duck? Pattern recognition still accepts this as a duck, even though not all features match 8 Image: duckrace.com

  9. Agenda 1. Pattern matching vs. recognition 2. From Finite Automata to Hidden Markov Models 3. Decoding: Viterbi algorithm 4. Training 9

  10. We can model systems using Finite Automata Weather model: possible states The State of the weather can be: • Sunny Sunny Cloudy • Cloudy • Rainy Rainy 10 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  11. We can model systems using Finite Automata Weather model: transitions 0.8 0.15 0.5 We can observe weather patterns and 0.2 determine probability Sunny Cloudy of transition between states 0.2 0.2 0.05 0.3 Rainy 0.6 11 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  12. We can model systems using Finite Automata Weather model: Sunny day example 0.8 0.15 0.5 Probability a sunny day is followed by: 0.2 Sunny Cloudy 0.2 0.2 0.05 0.3 Rainy 0.6 12 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  13. We can model systems using Finite Automata Weather model: Sunny day example 0.8 0.15 0.5 Probability a sunny day is followed by: 0.2 • Another sunny day 80% Sunny Cloudy 0.2 0.2 0.05 0.3 Rainy 0.6 13 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  14. We can model systems using Finite Automata Weather model: Sunny day example 0.8 0.15 0.5 Probability a sunny day is followed by: 0.2 • Another sunny day 80% Sunny Cloudy • A cloudy day 15% 0.2 0.2 0.05 0.3 Rainy 0.6 14 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  15. We can model systems using Finite Automata Weather model: Sunny day example 0.8 0.15 0.5 Probability a sunny day is followed by: 0.2 • Another sunny day 80% Sunny Cloudy • A cloudy day 15% • A rainy day 5% 0.2 0.2 0.05 0.3 Rainy 0.6 15 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  16. Model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy 0.2 0.2 0.05 0.3 Rainy 0.6 16 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  17. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy 0.2 0.2 0.05 0.3 Rainy 0.6 17 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  18. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy 0.2 0.2 0.05 0.3 Rainy 0.6 18 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  19. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy (0.8*0.05) 0.2 0.2 0.05 0.3 Rainy 0.6 19 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  20. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy (0.8*0.05) 0.2 0.2 • Could be cloudy, then rainy 0.05 0.3 Rainy 0.6 20 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  21. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy (0.8*0.05) 0.2 0.2 • Could be cloudy, then rainy 0.05 0.3 Rainy 0.6 21 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  22. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy (0.8*0.05) 0.2 0.2 • Could be cloudy, then rainy (0.15*0.3) 0.05 0.3 Rainy 0.6 22 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  23. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy (0.8*0.05) 0.2 0.2 • Could be cloudy, then rainy (0.15*0.3) 0.05 0.3 • Could be rainy, then rainy Rainy 0.6 23 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  24. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy (0.8*0.05) 0.2 0.2 • Could be cloudy, then rainy (0.15*0.3) 0.05 0.3 • Could be rainy, then rainy Rainy 0.6 24 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  25. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy (0.8*0.05) 0.2 0.2 • Could be cloudy, then rainy (0.15*0.3) 0.05 0.3 • Could be rainy, then rainy (0.05*0.6) Rainy 0.6 25 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

  26. FA model allows us to answer questions about the probability of events occurring Weather model: predict two days in advance Given today is sunny, 0.8 0.15 0.5 what is the probability it will be rainy two days from now? 0.2 Sunny Cloudy • Could be sunny, then rainy (0.8*0.05) 0.2 0.2 • Could be cloudy, then rainy (0.15*0.3) 0.05 0.3 • Could be rainy, then rainy (0.05*0.6) Rainy Total = (0.8*0.05) 0.6 + (0.15*0.3) + (0.05*0.6) = 0.115 26 Adapted from: https://pdfs.semanticscholar.org/b328/2eb0509442b80760fea5845e158168daee62.pdf

Recommend


More recommend