Docsity

Lecture 10: Evaluating Hypotheses in Machine Learning - Probability & Confidence Intervals, Study notes of Computer Science

Partial preview of the text

Download Lecture 10: Evaluating Hypotheses in Machine Learning - Probability & Confidence Intervals and more Study notes Computer Science in PDF only on Docsity!

Intro. to machine learning (CSI 5325)

Lecture 10: evaluating hypotheses

Greg Hamerly

Some content from Tom Mitchell.

Outline

1 Quick probability lesson

2 Sample error, true error

3 Estimators

4 Confidence intervals for observed hypothesis error

5 Binomial distribution, Normal distribution, Central Limit Theorem

Quick probability lesson

Random variable transformations

We can change random variables to get new ones: sum up 5 random variables: R = A + B + C + D + E divide a random variable by 8: S = F / 8 etc.

The properties of the new random variables (R, S) can be derived from the random variables used to make them (A, B, C , D, E , F ).

Quick probability lesson

Expected values

The expected value of a random variable X , written E [X ], is its ‘average’ value.

For discrete random variable X with possible values x 1 , x 2 ,... , xn:

E [X ] =

∑^ n i=

xi P(X = xi )

For continuous random variable Y :

E [Y ] =

−∞

y P(Y = y )dy

Quick probability lesson

Mean, variance, standard deviation

The mean of a random variable X is its expected value: μ = E [X ]

The variance of a random variable X is the expected value of the squared difference from the mean:

σ^2 = Var (X ) = E [(X − E [X ])^2 ]

=

∑^ n i=

(xi − E [X ])^2 P(X = xi ) (discrete)

−∞

(x − E [X ])^2 P(X = x)dx (continuous)

The standard deviation σ is the square-root of the variance.

Sample error, true error

Two Definitions of Error

The true error of hypothesis h with respect to target function f and distribution D is the probability that h will misclassify an instance drawn at random according to D. errorD(h) ≡ (^) xPr∈D[f (x) 6 = h(x)]

The sample error of h with respect to target function f and data sample S is the proportion of examples h misclassifies

errorS (h) ≡

n

x∈S

δ(f (x) 6 = h(x))

Where δ(f (x) 6 = h(x)) is 1 if f (x) 6 = h(x), and 0 otherwise. How well does errorS (h) estimate errorD(h)?

Sample error, true error

Example

Hypothesis h misclassifies 12 of the 40 examples in S

errorS (h) =^1240 =. 30 What is errorD(h)?

Estimators

Estimators

Experiment: 1 choose sample S of size n according to distribution D 2 measure errorS (h)

errorS (h) is a random variable (i.e., result of an experiment)

errorS (h) is an unbiased estimator for errorD(h)

Given observed errorS (h) what can we conclude about errorD(h)?

Confidence intervals for observed hypothesis error

Confidence Intervals

If S contains n examples, drawn independently of h and each other n ≥ 30 Then With approximately N% probability, errorD(h) lies in interval

errorS (h) ± zN

errorS (h)(1 − errorS (h)) n where N%: 50% 68% 80% 90% 95% 98% 99% zN : 0.67 1.00 1.28 1.64 1.96 2.33 2.

Confidence intervals for observed hypothesis error

errorS (h) is a Random Variable

Rerun the experiment with different randomly drawn S (of size n) Probability of observing r misclassified examples:

0

0 5 10 15 20 25 30 35 40

P(r)

Binomial distribution for n = 40, p = 0.

P(r ) = n! r !(n − r )! errorD(h)

r (^) (1 − errorD(h))n−r

Binomial distribution, Normal distribution, Central Limit Theorem

Normal Distribution Approximates Binomial

errorS (h) follows a Binomial distribution, with mean μerrorS (h) = errorD(h) standard deviation σerrorS (h)

σerrorS (h) =

errorD(h)(1 − errorD(h)) n

Approximate this by a Normal distribution with mean μerrorS (h) = errorD(h) standard deviation σerrorS (h)

σerrorS (h) ≈

errorS (h)(1 − errorS (h)) n

Binomial distribution, Normal distribution, Central Limit Theorem

Normal (aka Gaussian) probability distribution

0

-3 -2 -1 0 1 2 3

Normal distribution with mean 0, standard deviation 1

p(x) = √^1 2 πσ^2

e−^ (^12) ( x−σμ ) 2

The probability that X will fall into the interval (a, b) is given by ∫ (^) b

a

p(x)dx

Binomial distribution, Normal distribution, Central Limit Theorem

Normal (aka Gaussian) probability distribution

0

-3 -2 -1 0 1 2 3 80% of area (probability) lies in μ ± 1. 28 σ N% of area (probability) lies in μ ± zN σ

N%: 50% 68% 80% 90% 95% 98% 99% zN : 0.67 1.00 1.28 1.64 1.96 2.33 2.

Binomial distribution, Normal distribution, Central Limit Theorem

Notes on probability distribution equations

Where do the various parts come from?

Binomial: P(r ) = n! r !(n − r )! p

r (^) (1 − p)n−r

Gaussian: p(x) = √^1 2 πσ^2

e−^12 (^ x−σ μ) 2

Gaussian and Binomial are part of a class of useful distributions called the exponential family.