Class ROCCurve<U>
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
-
Constructor Summary
-
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.
-
Field Details
-
graph
The network.
-
-
Constructor Details
-
ROCCurve
Constructor.- Parameters:
graph
- the network for checking the relevance of the links.
-
-
Method Details
-
evaluate
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.
-