Class MeanPredictionDistance<U>

java.lang.Object
es.uam.eps.ir.relison.links.recommendation.metrics.novdiv.MeanPredictionDistance<U>
Type Parameters:
U - Type of the users.
All Implemented Interfaces:
es.uam.eps.ir.ranksys.metrics.SystemMetric<U,​U>

public class MeanPredictionDistance<U>
extends java.lang.Object
implements es.uam.eps.ir.ranksys.metrics.SystemMetric<U,​U>
Metric that finds the harmonic mean of the reciprocal distances between the different target user - candidate user pairs of the recommendation.
References:
  1. J. Sanz-Cruzado and P. Castells. Beyond Accuracy in Link Prediction. SoMePeaS 2019.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    (package private) DistanceCalculator<U> calculator
    The distance calculator.
    private int cutoff
    The cutoff of the recommendation
    private Graph<U> graph
    The training network.
    private java.util.List<es.uam.eps.ir.ranksys.core.Recommendation<U,​U>> recs
    The list of recommendations.
  • Constructor Summary

    Constructors 
    Constructor Description
    MeanPredictionDistance​(Graph<U> graph, int cutoff)
    Constructor.
    MeanPredictionDistance​(Graph<U> graph, DistanceCalculator<U> calc, int cutoff)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    void add​(es.uam.eps.ir.ranksys.core.Recommendation<U,​U> recommendation)  
    void combine​(es.uam.eps.ir.ranksys.metrics.SystemMetric<U,​U> systemMetric)  
    double evaluate()  
    void reset()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • graph

      private final Graph<U> graph
      The training network.
    • recs

      private final java.util.List<es.uam.eps.ir.ranksys.core.Recommendation<U,​U>> recs
      The list of recommendations.
    • cutoff

      private final int cutoff
      The cutoff of the recommendation
    • calculator

      DistanceCalculator<U> calculator
      The distance calculator.
  • Constructor Details

    • MeanPredictionDistance

      public MeanPredictionDistance​(Graph<U> graph, int cutoff)
      Constructor.
      Parameters:
      graph - the training graph.
      cutoff - recommendation cutoff.
    • MeanPredictionDistance

      public MeanPredictionDistance​(Graph<U> graph, DistanceCalculator<U> calc, int cutoff)
      Constructor.
      Parameters:
      graph - the training graph.
      calc - distance calculator.
      cutoff - recommendation cutoff.
  • Method Details

    • add

      public void add​(es.uam.eps.ir.ranksys.core.Recommendation<U,​U> recommendation)
      Specified by:
      add in interface es.uam.eps.ir.ranksys.metrics.SystemMetric<U,​U>
    • evaluate

      public double evaluate()
      Specified by:
      evaluate in interface es.uam.eps.ir.ranksys.metrics.SystemMetric<U,​U>
    • combine

      public void combine​(es.uam.eps.ir.ranksys.metrics.SystemMetric<U,​U> systemMetric)
      Specified by:
      combine in interface es.uam.eps.ir.ranksys.metrics.SystemMetric<U,​U>
    • reset

      public void reset()
      Specified by:
      reset in interface es.uam.eps.ir.ranksys.metrics.SystemMetric<U,​U>