lecture23.pdf

# lecture23.pdf - COMPSCI 240 Reasoning Under Uncertainty...

• Notes
• 84

This preview shows pages 1–16. Sign up to view the full content.

COMPSCI 240: Reasoning Under Uncertainty Arya Mazumdar University of Massachusetts at Amherst Fall 2016

This preview has intentionally blurred sections. Sign up to view the full version.

Lecture 23
Hypothesis Testing

This preview has intentionally blurred sections. Sign up to view the full version.

Hypothesis testing When you receive an email you have two “hypotheses”: H 1 = email is spam H 2 = email is not spam and note that these are partitioning events.
Hypothesis testing When you receive an email you have two “hypotheses”: H 1 = email is spam H 2 = email is not spam and note that these are partitioning events. You have some “observed data” e.g., D = email contains the word ‘cash’

This preview has intentionally blurred sections. Sign up to view the full version.

Hypothesis testing When you receive an email you have two “hypotheses”: H 1 = email is spam H 2 = email is not spam and note that these are partitioning events. You have some “observed data” e.g., D = email contains the word ‘cash’ How do you use the observed data to pick one of the hypotheses?
Hypothesis testing When you receive an email you have two “hypotheses”: H 1 = email is spam H 2 = email is not spam and note that these are partitioning events. You have some “observed data” e.g., D = email contains the word ‘cash’ How do you use the observed data to pick one of the hypotheses? We want to pick the “maximum a posteriori hypothesis” (MAP), i.e., the hypothesis H i than maximizes P ( H i | D ).

This preview has intentionally blurred sections. Sign up to view the full version.

Using Bayes Theorem If P ( H 1 ) = 0 . 7 , P ( H 2 ) = 0 . 3 , P ( D | H 1 ) = 1 / 2, P ( D | H 2 ) = 1 / 3 then:
Using Bayes Theorem If P ( H 1 ) = 0 . 7 , P ( H 2 ) = 0 . 3 , P ( D | H 1 ) = 1 / 2, P ( D | H 2 ) = 1 / 3 then: P ( H 1 | D ) = P ( H 1 D ) P ( D ) = P ( D | H 1 ) P ( H 1 ) P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) = 1 / 2 × 0 . 7 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) = 0 . 35 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 )

This preview has intentionally blurred sections. Sign up to view the full version.

Using Bayes Theorem If P ( H 1 ) = 0 . 7 , P ( H 2 ) = 0 . 3 , P ( D | H 1 ) = 1 / 2, P ( D | H 2 ) = 1 / 3 then: P ( H 1 | D ) = P ( H 1 D ) P ( D ) = P ( D | H 1 ) P ( H 1 ) P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) = 1 / 2 × 0 . 7 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) = 0 . 35 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) and similarly P ( H 2 | D ) = 0 . 3 × 1 / 3 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) = 0 . 1 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 )
Using Bayes Theorem If P ( H 1 ) = 0 . 7 , P ( H 2 ) = 0 . 3 , P ( D | H 1 ) = 1 / 2, P ( D | H 2 ) = 1 / 3 then: P ( H 1 | D ) = P ( H 1 D ) P ( D ) = P ( D | H 1 ) P ( H 1 ) P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) = 1 / 2 × 0 . 7 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) = 0 . 35 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) and similarly P ( H 2 | D ) = 0 . 3 × 1 / 3 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) = 0 . 1 P ( D | H 1 ) P ( H 1 ) + P ( D | H 2 ) P ( H 2 ) Therefore the MAP hypothesis is H 1 .

This preview has intentionally blurred sections. Sign up to view the full version.

Combining Observed Data Suppose we have two pieces of observed data: D 1 = email contains the word ‘cash’ D 2 = email contains the word ‘pharmacy’
Combining Observed Data Suppose we have two pieces of observed data: D 1 = email contains the word ‘cash’ D 2 = email contains the word ‘pharmacy’ The MAP hypothesis is the one maximizing P ( H j | D 1 D 2 ) where P ( H j | D 1 D 2 ) = P ( D 1 D 2 | H j ) P ( H j ) P ( D 1 D 2 | H 1 ) P ( H 1 ) + P ( D 2 D 2 | H 2 ) P ( H 2 )

This preview has intentionally blurred sections. Sign up to view the full version.

Naive Bayes Classification In Naive Bayes Classification (NBC) we assume that the observed data is independent conditioned on either of the hypotheses, i.e., P ( D 1 D 2 | H 1 ) = P ( D 1 | H 1 ) P ( D 2 | H 1 ) P ( D 1 D 2 | H 2 ) = P ( D 1 | H 2 ) P ( D 2 | H 2 )
Naive Bayes Classification In Naive Bayes Classification (NBC) we assume that the

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern