Assume I trained a binary classifier $f$ and I was able to extract an optimal decision value $t$ such that the binary output $\widehat{y}$ of the classifier is: $$ \widehat{y} = \begin{cases} 1, & f(x) \geq t \\ 0, & f(x) < t \end{cases} $$ Intrinsic to this classifier (at threshold $t$) are the True Positive Rate and False Positive Rate:
- $TPR = \Pr(\widehat{y}=1|y=1)$
- $FPR = \Pr(\widehat{y}=1|y=0)$
where $y$ is the true label of the sample.
Let's now assume that the classifier is deployed into a staging environment (call it $S$) for several weeks, where it will be presented with a fraction $N = \Pr(y=0|S)$ of negative and $P = \Pr(y=1|S)$ of positive examples.
My question is this: is it correct to expect the following fraction of positive classifications given the data in $S$? $$ \begin{align} \Pr(\widehat{y}=1|S) &= \Pr(\widehat{y}=1|y=1,S) \cdot \Pr(y=1|S) \\ &+ \Pr(\widehat{y}=1|y=0,S) \cdot \Pr(y=0|S) \\ &= TPR \cdot P + FPR\cdot N \end{align} $$
That is, are $TPR, FPR$ independent of $S$?
- $\Pr(\widehat{y}=1|y=1,S) = \Pr(\widehat{y}=1|y=1) = TPR$
- $\Pr(\widehat{y}=1|y=0,S) = \Pr(\widehat{y}=1|y=0) = FPR$
My intuition is that this holds provided that the sample distribution in $S$ is similar to the hold-out test set used to compute $TPR$, but I need some help with formalizing this concept. Moreover, are there any other caveats?