9.2. Loss Functions#

Loss functions measure the discrepancy between a test representation and a candidate mixture of training representations. They are used by compose and matching quantifiers to estimate prevalences.

9.2.1. Available losses#

9.2.2. Example#

from mlquantify.losses import get_loss

loss = get_loss("hellinger")
value = loss([0.4, 0.6], [0.5, 0.5])