Abstract base class for evaluation curves.
More...
#include <EvaluationMetric.h>
Abstract base class for evaluation curves.
The evualation curves are generated based on the predictions calculated by the link predictor and a testGraph to compare against.
NetworKit::EvaluationMetric::EvaluationMetric 
( 
 ) 

NetworKit::EvaluationMetric::EvaluationMetric 
( 
const Graph & 
testGraph  ) 


explicit 
 Parameters

testGraph  Graph containing the links to use for evaluation 
predictions  Dyadscorepairs whose prediction quality will be evaluated 
virtual NetworKit::EvaluationMetric::~EvaluationMetric 
( 
 ) 


virtualdefault 
double NetworKit::EvaluationMetric::getAreaUnderCurve 
( 
std::pair< std::vector< double >, std::vector< double >> 
curve  ) 
const 

virtual 
Returns the area under the given curve by using the trapezoidal rule.
 Parameters

curve  Curve whose AUC to determine 
 Returns
 the area under the given curve
double NetworKit::EvaluationMetric::getAreaUnderCurve 
( 
 ) 
const 

virtual 
Returns the area under the curve that was most recently calculated by this instance.
This implies that getCurve() has to get called beforehand.
 Returns
 area under the most recently calculated curve
std::pair< std::vector< double >, std::vector< double > > NetworKit::EvaluationMetric::getCurve 
( 
std::vector< LinkPredictor::prediction > 
predictions, 


count 
numThresholds = 1000 

) 
 

virtual 
Returns a pair of X and Yvectors describing the evaluation curve generated from the predictions.
The latest yvalue will be used as a tiebreaker in case there are multiple yvalues for one xvalue. 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 yvalues can map to one xvalue in which case the tiebreaking behaviour described above will intervene.
 Parameters

predictions  Predictions to evaluate 
numThresholds  The number of thresholds to use the metric on 
 Returns
 a pair of vectors where the first vectors contains all xvalues and the second one contains the corresponding yvalue
void NetworKit::EvaluationMetric::setTestGraph 
( 
const Graph & 
newTestGraph  ) 

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.
 Parameters

newTestGraph  New graph to use as ground truth 
std::vector<count> NetworKit::EvaluationMetric::falseNegatives 

protected 
False negatives regarding the corresponding threshold.
std::vector<count> NetworKit::EvaluationMetric::falsePositives 

protected 
False positives regarding the corresponding threshold.
std::pair<std::vector<double>, std::vector<double> > NetworKit::EvaluationMetric::generatedPoints 

protected 
Points describing the generated curve. Will be set after a call to getCurve.
count NetworKit::EvaluationMetric::numNegatives 

protected 
Absolute number of negative instances in the predictionset.
count NetworKit::EvaluationMetric::numPositives 

protected 
Absolute number of positive instances in the predictionset.
Predictions that should be evaluated.
const Graph* NetworKit::EvaluationMetric::testGraph 

protected 
Used to evaluate the binary predictions at the thresholds.
std::vector<index> NetworKit::EvaluationMetric::thresholds 

protected 
Indices for the thresholds to use. All nodepairs with an index < thresholds[i] will be regarded as links.
std::vector<count> NetworKit::EvaluationMetric::trueNegatives 

protected 
True negatives regarding the corresponding threshold.
std::vector<count> NetworKit::EvaluationMetric::truePositives 

protected 
True positives regarding the corresponding threshold.
The documentation for this class was generated from the following files: