Class KendallsTauDyadRankingLoss
- java.lang.Object
-
- ai.libs.jaicore.ml.dyadranking.loss.KendallsTauDyadRankingLoss
-
- All Implemented Interfaces:
DyadRankingLossFunction
public class KendallsTauDyadRankingLoss extends java.lang.Object implements DyadRankingLossFunction
Computes the rank correlation measure known as Kendall's tau coefficient, i.e. (C - D) / (K * (K-1) /2), where C and D are the number of concordant (put in the right order) and discordant (put in the wrong order) pairs of dyads and K is the length of the dyad ranking. Lies between -1 (reversed order) and +1 (same order). Assumes the dyads in the ranking to be pairwise distinct.
-
-
Constructor Summary
Constructors Constructor Description KendallsTauDyadRankingLoss()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleloss(IDyadRankingInstance actual, IDyadRankingInstance predicted)Computes the loss between the actual dyad ordering and predicted dyad ordering, represented by dyad ranking instances.
-
-
-
Method Detail
-
loss
public double loss(IDyadRankingInstance actual, IDyadRankingInstance predicted)
Description copied from interface:DyadRankingLossFunctionComputes the loss between the actual dyad ordering and predicted dyad ordering, represented by dyad ranking instances.- Specified by:
lossin interfaceDyadRankingLossFunction- Parameters:
actual- the correct orderingpredicted- the predicted ordering- Returns:
- the loss between the predicted and correct ordering, depending on the implementation
-
-