Cost-sensitive Bayes classifier (source code)

= Cost-sensitive Bayes classifier
{title2=$c(2\mid1)\pi_1f_1(x)\ge c(1\mid2)\pi_2f_2(x)$}

With zero cost for correct classifications, assign class one when the displayed inequality holds and class two otherwise. It compares conditional expected losses; ties may be resolved arbitrarily. For positive costs and densities, the log likelihood ratio threshold is $\log(c(1\mid2)\pi_2/(c(2\mid1)\pi_1))$.