rafguns / linkpred

Easy link prediction tool
Other
140 stars 46 forks source link

UndefinedError: Measure is undefined if there are no relevant or retrieved items #39

Open umer7267 opened 1 year ago

umer7267 commented 1 year ago

I am getting the undefined error when plotting ROC Curve of an evaluation using the following code:

n = len(test)
num_universe = n * (n - 1) // 2

test_set = set(linkpred.evaluation.Pair(u, v) for u, v in test.edges())
evaluation = linkpred.evaluation.EvaluationSheet(cn_results, test_set, num_universe)
plt.plot(evaluation.fallout(), evaluation.recall())
plt.show()
rafguns commented 1 year ago

Hi! Can you share the network test? For instance, as an edgelist or in some other networkx-compatible format?