recsyschallenge / 2017

40 stars 24 forks source link

Division by zero in recommendation_worker.py #17

Closed abdollahpouri closed 7 years ago

abdollahpouri commented 7 years ago

Hello all,

In recommendation_worker.py line 24 we have :

if x.title_match() > 0

When the result of this check is false, the data[] which was a list declared in line 18 will still remain an empty list and therefore, the second "if" where is in line 29 will also be false and it means the num_evaluated variable which was initialized to zero in line 16 is still zero. That means in line 59 where we have:

score = str(average_score / num_evaluated)

we will have division by zero.

Thanks, Himan