The Detector That Never Looks

Loss FunctionsMedium+20 XP+20

The Detector That Never Looks

A card issuer's fraud detector reports one number per transaction: the probability that the transaction is fraudulent. The other option, legitimate, gets whatever is left.

Its training set holds 5,000 transactions, of which 100 are fraudulent.

Before training anything real, the team builds a baseline that never looks at the transaction. It outputs the same probability qqq for every transaction, and the team may pick any qqq strictly between 000 and 111.

The loss is binary cross-entropy, averaged over all 5,000 transactions. For one transaction it is

−ln⁡(probability the detector gave to the true answer)-\ln(\text{probability the detector gave to the true answer})−ln(probability the detector gave to the true answer)

so a fraudulent transaction costs −ln⁡q-\ln q−lnq and a legitimate one costs −ln⁡(1−q)-\ln(1 - q)−ln(1−q). Here ln⁡\lnln is the natural logarithm.

With qqq chosen as well as possible, what is the lowest average loss this baseline can reach?

Round to 3 decimal places.

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.