Misclassification Error probablity Let ρ be a probability distribution on $Z = X \times Y$  and $(X,Y)$ be the corresponding random variable .
The missclassifications error for a $f:X\to Y $ is defined to be 
the probability of the event ${f(x)\neq y}$ 
$$R(f)=Prob {f(x)\neq Y} = \int P(Y≠f(x)│x) d_ρ (x)$$
Will anybody please explain me this integral and its interpretation related to error
 A: The probability that $Y$ is different from a constant $c$ knowing $x$ is: 
$$
\int \rho(y|x)\mathbb{1}(y\neq c)  dy=\Pr(Y\neq c|x).
$$
But if you know $x$, you know $f(x)$ and it behaves like a constant $c$, knowing $x$. Therefore, in a similar way the probability that $Y\neq f(x)$ knowing $x$ is:
$$
\int \rho(y|x)\mathbb{1}(y\neq f(x))  dy=\Pr(Y\neq f(x)|x).
$$
For each $x$ you can calculate this probability and at the end, using Bayes theorem you have:
$$
\Pr(Y\neq f(X))=\int \rho(x)\int \rho(y|x)\mathbb{1}(y\neq f(x))  dydx=\int \rho(x)\Pr(Y\neq f(x)|x)dx.
$$
The intuition behind the formula comes from Bayes theorem. To calculate probability of an event, you can find the probability of the event conditionally knowing another random variable and then averaging all the conditional probabilities with respect to the random variable.
Example: Suppose $X$ is a Gaussian random variable $\mathcal{N}(0,1)$ and $Y=X+N$ where $N$ is an independent Bernoulli random variable $\mathcal{B}(0.5)$. Such a scenario occurs when  someone is going to send $X$ over a noisy channel and to estimate what is received, namely $Y$. Also suppose that this person is giving $f(X)$ as the estimate and we want to see what is the error probability which is $\Pr(Y\neq f(X))$. Assume that we go with a simple choice like $f(X)=X$. Now for a given $X=x$, the conditional probability of error is:
$$
\Pr(Y\neq x|X=x)= \Pr(x+N\neq x|X=x)=\Pr(N\neq 0)=\Pr(N=1)=0.5
$$
So for each $X=x$ the conditional probability of error is 0.5. Therefore the error probability is $0.5$. 
You can see in this case that this method gives you the answer easily.
