Conditional probability for classification In Book "Machine Learning: A probabilistic Perspective" Page 30, it tries to give a generative classifiers solution using conditional probability as
$$p(y=c|x,\theta)=\frac{p(y=c|\theta)p(x|y=c,\theta)}{\sum_{c'}p(y=c'|\theta)p(x|y=c',\theta)}$$
I understand the numerator but I don't understand the denominator. How did they come to that?

Starting from the definition of a conditional probability using Bayes' rule
$$p(y=c|x,\theta)=\frac{\color{blue}{p(y=c,x,\theta)}}{p(x,\theta)}=\frac{\color{blue}{p(x|y=c,\theta)p(y=c|\theta)p(\theta)}}{p(x,\theta)}$$
where we use the chain rule in the numerator (parts highlighted in blue), to express the joint density as a product of the conditional densities.  
The denominator is $p(x,\theta)$, which can be expressed as the marginal of the joint density $p(x,\theta,y=c')$ integrated over $y$ 
$$p(x,\theta)=\sum_{y}p(x,\theta,y=c')$$
using the chain rule of conditional densities we express $p(x,\theta,y=c')$ as $$p(x,\theta,y=c')=p(x|\theta,y=c')p(y=c'|\theta)p(\theta)$$
Combining these rules leads to 
$$\begin{align}p(x,\theta)&=\sum_{y\in c'}p(x,\theta,y=c')\\&=\sum_{y\in c'}p(x|\theta,y=c')p(y=c'|\theta)p(\theta)
\\&=p(\theta)\sum_{y\in c'}p(x|\theta,y=c')p(y=c'|\theta)\end{align}$$
Finally, given the numerator and denominator, we have the desired expression (note the cancellation of the $p(\theta)$ terms):-
$$\begin{align}p(y=c|x,\theta)&=\frac{p(x|y=c,\theta)p(y=c|\theta)p(\theta)}{p(\theta)\sum_{y\in c'}p(x|\theta,y=c')p(y=c'|\theta)}\\&=\frac{p(x|y=c,\theta)p(y=c|\theta)}{\sum_{y\in c'}p(x|\theta,y=c')p(y=c'|\theta)}\end{align}$$
