java.lang.Object
es.uam.eps.ir.relison.links.linkprediction.metrics.ROCCurve<U>

public class ROCCurve<U>
extends java.lang.Object
Given a list, finds the receiver operating characteristic (ROC) curve.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private Graph<U> graph
    The network.
  • Constructor Summary

    Constructors 
    Constructor Description
    ROCCurve​(Graph<U> graph)
    Constructor.
  • Method Summary

    Modifier and Type Method Description
    java.util.List<Pair<java.lang.Double>> evaluate​(Prediction<U> pred)
    Computes the ROC curve for a prediction.
    java.util.List<Pair<java.lang.Double>> evaluate​(Prediction<U> pred, java.util.function.Predicate<Pair<U>> filter)
    Computes the ROC curve for a prediction.
    java.util.List<Pair<java.lang.Double>> evaluate​(Prediction<U> pred, java.util.stream.Stream<Pair<U>> candidates)
    Computes the ROC curve for a prediction.

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • ROCCurve

      public ROCCurve​(Graph<U> graph)
      Constructor.
      Parameters:
      graph - the network for checking the relevance of the links.
  • Method Details

    • evaluate

      public java.util.List<Pair<java.lang.Double>> evaluate​(Prediction<U> pred)
      Computes the ROC curve for a prediction. It considers that the prediction is applied over all possible edges in the network (regardless of whether they previously existed or not).
      Parameters:
      pred - the prediction.
      Returns:
      the value of the metric.
    • evaluate

      public java.util.List<Pair<java.lang.Double>> evaluate​(Prediction<U> pred, java.util.function.Predicate<Pair<U>> filter)
      Computes the ROC curve for a prediction. It considers that the prediction is applied over all possible edges in the network (regardless of whether they previously existed or not).
      Parameters:
      pred - the prediction.
      filter - a filter for indicating the pairs of users to consider.
      Returns:
      the value of the metric.
    • evaluate

      public java.util.List<Pair<java.lang.Double>> evaluate​(Prediction<U> pred, java.util.stream.Stream<Pair<U>> candidates)
      Computes the ROC curve for a prediction. It considers that the prediction is applied over all possible edges in the network (regardless of whether they previously existed or not).
      Parameters:
      pred - the prediction.
      candidates - an stream containing the set of pairs to consider for the curve.
      Returns:
      the value of the metric.