Interface LinkPredictionMetric<U>
- Type Parameters:
U
- type of the users.
- All Known Implementing Classes:
AbstractClassificationMetric
,Accuracy
,AUC
,F1Score
,Precision
,Recall
public interface LinkPredictionMetric<U>
Interface for defining metrics for evaluating link prediction algorithms.
-
Method Summary
Modifier and Type Method Description double
evaluate(Graph<U> graph, Prediction<U> pred)
Evaluates a link prediction algorithm.double
evaluate(Graph<U> graph, Prediction<U> pred, java.util.function.Predicate<Pair<U>> filter)
Evaluates a link prediction algorithm.double
evaluate(Graph<U> graph, Prediction<U> pred, java.util.stream.Stream<Pair<U>> pairs)
Evaluates a link prediction algorithm.
-
Method Details
-
evaluate
Evaluates a link prediction algorithm. It considers that the prediction is applied over all pairs of users in the network.- Parameters:
graph
- a graph containing the set of links to predict.pred
- the prediction.- Returns:
- the value of the metric.
-
evaluate
Evaluates a link prediction algorithm. It considers that the prediction is only applied for a subset of pairs of users in the network: those who pass a given filter.- Parameters:
graph
- a graph containing the set of links to predict.pred
- the prediction.filter
- the filter for the different pairs of users.- Returns:
- the value of the metric.
-
evaluate
Evaluates a link prediction algorithm. It considers that we only apply this over a given set of links.- Parameters:
graph
- a graph containing the set of links to predict.pred
- the prediction.pairs
- the set of users to apply the recommendation to.- Returns:
- the value of the metric.
-