Class TopKOfPredicted

  • All Implemented Interfaces:
    DyadRankingLossFunction

    public class TopKOfPredicted
    extends java.lang.Object
    implements DyadRankingLossFunction
    Calculates if the top-k dyads of the predicted ranking match the top-k dyads of the actual ranking. This ignores the rankings.
    • Constructor Summary

      Constructors 
      Constructor Description
      TopKOfPredicted​(int k)
      Specifies the amount of top rankings to consider.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      double loss​(IDyadRankingInstance actual, IDyadRankingInstance predicted)
      Computes the loss between the actual dyad ordering and predicted dyad ordering, represented by dyad ranking instances.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TopKOfPredicted

        public TopKOfPredicted​(int k)
        Specifies the amount of top rankings to consider.
        Parameters:
        k -
    • Method Detail

      • loss

        public double loss​(IDyadRankingInstance actual,
                           IDyadRankingInstance predicted)
        Description copied from interface: DyadRankingLossFunction
        Computes the loss between the actual dyad ordering and predicted dyad ordering, represented by dyad ranking instances.
        Specified by:
        loss in interface DyadRankingLossFunction
        Parameters:
        actual - the correct ordering
        predicted - the predicted ordering
        Returns:
        the loss between the predicted and correct ordering, depending on the implementation