Docsity

Lecture 19: Data Mining - Max Likelihood, Least Squares, Naive Bayes & Laplace - Prof. Nar, Study notes of Computer Science

Toggle sidebar
bg1
CS 6604: Data Mining Fall 2007
Lecture 19 — October 24, 2007
Lecture: Naren Ramakrishnan Scribe: Yong Ju Cho
1 Overview
In the last lecture we discussed the relationships between different modeling paradigms such as the Bayesian
approach, Maximum A Posteriori (MAP) approach, Maximum Likelihood (ML) approach, and the Least-
squares (LS) method.
In this lecture we first prove that equivalence of LS and ML under the assumption of normally distributed
error. Then, the notions of the naive Bayesian classifier and the Laplace estimate are discussed.
2 Maximum Likelihood and Least Squares
We say that fis a least squares hypothesis if it minimizes X
i
[yi−f(xi)]2.
For instance, when f(xi) = axi+bi, the least square constraints define a quadratic function with bowl
shape, thus having a unique (global) minimum. Hence, the line which satisfy the least square constraints is
unique.
Let us explore the ML approach with a ‘line’ hypothesis. Then,
hML = arg max
hP(D|h)
= arg max
hΠiP(di|h)
where P(D|h) = ΠiP(di|h)by the assumption of independent events.
If we can assume that the error is normally distributed (around zero), then
yi=f(xi) + N(0, σ2)
Then the ML hypothesis becomes:
hML = arg max
hΠi
1
√2πσ e
−(yi−f(xi))2
2σ2
= arg max
hΠie
−(yi−f(xi))2
2σ2
= arg max
hln(Πie
−(yi−f(xi))2
2σ2)
= arg max
hX−(yi−f(xi))2
2σ2
= arg min
hX(yi−f(xi))2
2σ2
1
pf3
pf4

Partial preview of the text

Download Lecture 19: Data Mining - Max Likelihood, Least Squares, Naive Bayes & Laplace - Prof. Nar and more Study notes Computer Science in PDF only on Docsity!

CS 6604: Data Mining Fall 2007

Lecture 19 — October 24, 2007

Lecture: Naren Ramakrishnan Scribe: Yong Ju Cho

1 Overview

In the last lecture we discussed the relationships between different modeling paradigms such as the Bayesian approach, Maximum A Posteriori (MAP) approach, Maximum Likelihood (ML) approach, and the Least- squares (LS) method.

In this lecture we first prove that equivalence of LS and ML under the assumption of normally distributed error. Then, the notions of the naive Bayesian classifier and the Laplace estimate are discussed.

2 Maximum Likelihood and Least Squares

We say that f is a least squares hypothesis if it minimizes

i

[yi − f (xi)]^2.

For instance, when f (xi) = axi + bi, the least square constraints define a quadratic function with bowl shape, thus having a unique (global) minimum. Hence, the line which satisfy the least square constraints is unique.

Let us explore the ML approach with a ‘line’ hypothesis. Then,

hM L = arg max h P (D|h) = arg max h

Πi P (di|h)

where P (D|h) = Πi P (di|h) by the assumption of independent events.

If we can assume that the error is normally distributed (around zero), then

yi = f (xi) + N (0, σ^2 )

Then the ML hypothesis becomes:

hM L = arg max h

Πi

2 πσ

e

−(yi−f (xi))^2 2 σ^2

= arg max h Πi e

−(yi−f (xi))^2 2 σ^2

= arg max h ln(Πi e

−(yi−f (xi))^2 2 σ^2 )

= arg max h

∑ (^) −(yi − f (xi))^2 2 σ^2

= arg min h

∑ (^) (yi − f (xi))^2 2 σ^2

As has been shown in the last equation, the least square constraint can be derived from a probabilistic model. As must be clear from the equations, this theory works for not only for a line but also for any hypothesis.

Question: When is LS not appropriate?

Answer: If the error is not normally distributed, the above derivation does not work.

Aside: The data supporting Mendel’s laws of inheritance was suspected to be too perfect by Fisher [Fis36]. Because some of Mendel’s ‘factors’ can come from the same chromosome, they may not assort indepen- dently. There are still ongoing debates on this issues, e.g., see [Nov04].

3 The Naive Bayes Classifier

The Bayesian approach and MAP approach can have completely different results as in the following exam- ple.

Example: Classify a plant as to whether it is poisonous or edible.

Table 1: Hypotheses of edibility Hypothesis Predicted class Posterior probability h 1 poisonous 0. h 2 edible 0. h 3 edible 0.

P (class|plant) =

h

P (class, h|plant)

h

P (class|h) × P (h|plant)

So P (class = poisonous|plant) is:

P (class = poisonous|plant) =

h

P (class|h) × P (h|plant)

= 1 × 0 .4 + 0 × 0 .3 + 0 × 0. 3 = 0. 4

Similarly P (class = edible|plant) is 0. 6. The Bayesian approach hence will conclude that the plant is edible. Whereas the MAP hypothesis will conclude that the plant is poisonous.

Table 3: Maximum Likelihood vs Laplace X PM L(X) PLaplace(X) tiger 14 15 1001 elephant 14 15 1001 lion 14 15 1001 bear 14 15 1001 unseen 15 10096

be, for instance 1+04+1 or even (^) 4+961+0 as shown in 3. Hence, the Laplace estimate reserves some probability for the unseen instances. The problem with the Laplace estimate is that it is not accurate all the time [GS95], an issue addressed by the Good-Turing estimator. This estimator was invented by Good and Turing during World War II. It is byproduct of researches for breaking the cipher of Enigma. The Good-Turing estimate is shown to be asymptotically optimal[OSZ03].

References

[Dom97] P.M. Domingos. A unified approach to concept learning. PhD thesis, University of California at Irvine, Irvine, CA, USA, 1997.

[Fis36] R.A. Fisher. Has Mendel’s work been rediscovered? Annals of Science, 1(2):115–137, 1936.

[GS95] W.A. Gale and G. Sampson. Good-turing frequency smoothing without tears. Quantitative Lin- guistics, 2(3):217–237, 1995.

[Nov04] C.E. Novitski. Revision of Fisher’s analysis of Mendel’s garden pea experiments. Genetics, 166(3):1139–1140, 2004.

[OSZ03] A. Orlitsky, N.P. Santhanam, and J. Zhang. Always good turing: Asymptotically optimal proba- bility estimation. Science, 302(5644):427–431, 2003.