In my probabilistic machine learning notes, it is stated that: \begin{equation} P(y|D,x)=\int P(y|f,D,x)P(D,f) df \end{equation} 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.

  • 2
    $\begingroup$ 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).$$ $\endgroup$ Commented Dec 17, 2019 at 3:31
  • $\begingroup$ Do you have a source that your notes come from? A textbook, perhaps? $\endgroup$ Commented Dec 17, 2019 at 3:31

1 Answer 1


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


Not the answer you're looking for? Browse other questions tagged or ask your own question.