Closed imhaggarwal closed 9 months ago
from what I see in the picture I belive the error is on your end, on line 38 you are trying to divide $predValue = $sum / $freq
in the use case where $vectors[0]
is empty, the loop will be skipped and the value of $freq
in that case will be 0. so you need to check first the value of $freq
before you divide.
Thanks for your reply. I'm sorry I think I am missing one important detail. The code which is there in the screenshot is from the file phpjuice\opencf\src\Algorithms\Slopeone\Predictor.php . I have not written this code, I just called the getPrediction function.
hmm I will check that it's been a while since I worked on this package I will make sure to fix the issue.
First of all thank you for developing such an excellend library. While predicting, I sometimes get![image](https://github.com/phpjuice/opencf/assets/22271943/8e1e3af8-d591-4dd7-9546-26c2391bf958)
Division by zero
error depending on the input data for prediction. Moreover, it also gives this error verying the algorithm used for training. Is there any condition under which it behaves like this which I'm missing? I'm attaching the error screenshot which might help in debugging. Thank you