Bayesian Methods in Machine Learning: Pros and Cons
A Bayesian method states what you believe about a model's parameters before seeing data, as a prior, and then updates that belief into a posterior after seeing the data. Hastie, Tibshirani, and Friedman describe it in Section 8.3: you specify a sampling model Pr(Z | θ) and a prior Pr(θ) "reflecting our knowledge about θ before we see the data," and compute the posterior Pr(θ | Z) = Pr(Z | θ) Pr(θ) / ∫ Pr(Z | θ) Pr(θ) dθ, "which represents our updated knowledge about θ after we see the data."
What you gain. The posterior keeps the uncertainty that is left after seeing the data. The authors say the Bayesian approach differs from the frequentist one in using a prior "to express the uncertainty present before seeing the data, and to allow the uncertainty remaining after seeing the data to be expressed in the form of a posterior distribution." That carries into prediction: the predictive distribution averages over the posterior, while the maximum likelihood approach plugs in a single estimate, which, in their words, "does not account for the uncertainty in estimating θ." A prior can also state a belief you hold, such as that a function should be smooth.
What you pay. You have to choose the prior, and the choice matters. The authors' smoothing example uses a Gaussian prior with variance τ. With τ = 1 the posterior curves are smoother than the bootstrap curves, because "more prior weight on smoothness" was imposed, and as τ grows without bound the posterior and the bootstrap distribution coincide. They also say you can understand the posterior by drawing samples from it or summarizing it with its mean or mode. My gloss on that: the integral in the denominator rarely has a closed form, so real problems need sampling or approximation, and that costs computing time.
Try it by hand. A coin lands heads 8 times in 10 flips. Maximum likelihood says the chance of heads is 8/10 = 0.80. A Bayesian starts with a prior over that chance. With a mild Beta(2, 2) prior, which leans slightly toward fair, the posterior is Beta(10, 4), whose mean is 10/14 = 0.714. With a flat Beta(1, 1) prior the posterior mean is 9/12 = 0.75. With a stubborn Beta(50, 50) prior, which acts like 100 earlier flips split evenly, the posterior mean is 58/110 = 0.527, and the ten new flips barely move it. I checked all three by numerical integration. Same data, three answers, and the difference is entirely the prior. The Beta forms are the standard conjugate pair, which is my addition and not from the chapter I read.
The trap: believing a posterior makes a wrong model reliable. The posterior describes belief given the model and the prior. If the model is wrong, say the flips are not independent, then the posterior is a precise answer to the wrong question.
Prof Rod's rule: write your prior down, check how much the answer moves when you change it, and never confuse a tidy posterior with a correct model.