Defined in File EvaluationMetric.hpp
public NetworKit::PrecisionRecallMetric
(Class PrecisionRecallMetric)
public NetworKit::ROCMetric
(Class ROCMetric)
Abstract base class for evaluation curves. The evaluation curves are generated based on the predictions calculated by the link predictor and a testGraph to compare against.
Subclassed by NetworKit::PrecisionRecallMetric, NetworKit::ROCMetric
Public Functions
testGraph – Graph containing the links to use for evaluation
predictions – Dyad-score-pairs whose prediction quality will be evaluated
Default destructor.
Sets a new graph to use as ground truth for evaluation. Note that this won’t reset the most recently calculated curve and as a consequence getAreaUnderCurve() const will still behave as expected by returning the AUC of the most recent curve.
newTestGraph – New graph to use as ground truth
Returns a pair of X- and Y-vectors describing the evaluation curve generated from the predictions. The latest y-value will be used as a tie-breaker in case there are multiple y-values for one x-value. Note that the given number of thresholds (numThresholds) is an upper bound for the number of points returned. This is due to the fact that multiple y-values can map to one x-value in which case the tie-breaking behavior described above will intervene.
predictions – Predictions to evaluate
numThresholds – The number of thresholds to use the metric on
a pair of vectors where the first vectors contains all x-values and the second one contains the corresponding y-value
Returns the area under the given curve by using the trapezoidal rule.
curve – Curve whose AUC to determine
the area under the given curve
Returns the area under the curve that was most recently calculated by this instance. This implies that getCurve() has to get called beforehand.
area under the most recently calculated curve
Protected Attributes
Points describing the generated curve. Will be set after a call to getCurve
Predictions that should be evaluated.