# How to prove P(y|D,x)=∫P(y|f,D,x)P(D,f)df [duplicate]

In my probabilistic machine learning notes, it is stated that: $$$$P(y|D,x)=\int P(y|f,D,x)P(D,f) df$$$$ However I am unsure how to evaluate the right hand equation to prove this.

For context: This would be for a classification with y representing each class. D is your test datum and x is the training data set. f is your predictive function, f:x->y

The equation is copied correctly from my notes and it is just the math I am struggling with.

• Assuming that $P(\cdot)$ represents a probability density function, it seems like an odd representation. Since $f$ is being integrated out, it seems that integrand is the joint conditional density, $p(y, f | D,x)$, which can be factorized as $$p(y, f | D,x) = p(y | f, D, x) p(f | D, x).$$ Commented Dec 17, 2019 at 3:31
• Do you have a source that your notes come from? A textbook, perhaps? Commented Dec 17, 2019 at 3:31

It is incorrect, it should be $$$$P(y|D,x)=\int P(y|f,D,x)P(f|D,x) df$$$$ which simplifies into $$$$P(y|D,x)=\int P(y|f,D,x)P(f|D) df$$$$ if $$f$$ only depends on $$D$$