rafguns / linkpred

Easy link prediction tool
Other
141 stars 46 forks source link

ZeroDivisionError #30

Open TaousDev opened 4 years ago

TaousDev commented 4 years ago

https://github.com/rafguns/linkpred/blob/ae7adc8147204e8d0564df72d33e486df62dab50/linkpred/predictors/neighbour.py#L28

in AdamicAdar i got ZeroDivisionError : floar division by zero

Any idea on how to fix this ? Thank you

Capture

rafguns commented 4 years ago

Thanks for the report. This looks like a bug. Can you provide a minimal test case (small graph) where the problem occurs?

TaousDev commented 4 years ago

I managed to fix it, using numpy, instead of math.log() I used numpy.log()

I'm also having trouble around the universe term that is used in EvaluationSheet(), I need this to get the confusion matrix and accuracy

Thank you

rafguns commented 4 years ago

Thanks. Good to know that it can be solved using numpy.log but I woud like to understand the issue before applying a fix. So if you can supply an example, that would still be much appreciated.

Can you open a separate issue relating to EvaluationSheet? Thanks!