Skip to content

@graphty/algorithms / index / evaluateCommonNeighbors

Function: evaluateCommonNeighbors() ​

evaluateCommonNeighbors(trainingGraph, testEdges, nonEdges, options): object

Defined in: link-prediction/common-neighbors.ts:178

Calculate precision and recall for link prediction evaluation

Parameters ​

trainingGraph ​

Graph

The training graph without test edges

testEdges ​

[NodeId, NodeId][]

Array of node pairs that are actual edges

nonEdges ​

[NodeId, NodeId][]

Array of node pairs that are not edges

options ​

LinkPredictionOptions = {}

Link prediction options

Returns ​

object

Evaluation metrics including precision, recall, F1 score, and AUC

auc ​

auc: number

f1Score ​

f1Score: number

precision ​

precision: number

recall ​

recall: number