-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
comparison of Float with Float failed (ArgumentError) on a simple training test #27
Comments
Hmmmm @jekyll/classifier-reborn? |
@hamac Can you provide any more details on how to reproduce this error? I can't seem to get it to happen. Which Ruby version are you using? |
I was finally able to reproduce this. It seems that the problem is caused by The arc tangent function here being called on the quotient of some rotations. If the rotations return 0.0 for the dividend and divisor then NaN is returned. It propagates to the sort function here. Where it finally explodes. I can probably fix it, but it could have introduce other bugs. I'm not the best at doing hairy matrix manipulations. Any ideas @jekyll/classifier-reborn? |
Holy moly, that is the most convoluted code I have ever read. Yikes. What is the practical meaning of the rotations returning 0.0? That a match wasn't found? We can probably write a better SVD... |
I think that might be what it means... but I'm not 100% sure. I need to do some more reading about SVDs/ask the guys at the company next to mine. I think we could definitely write something more maintainable. For what its worth here is how Numpy does SVD. I've never written more than 15 lines of Python so I couldn't quite reproduce it. So what is the plan from here? Should make some improvements in place for now, or plan a full rewrite? Looks trivial to generate test cases with Wolfram Alpha. And I can brush up on linear algebra in the mean time. |
Hi,
I had an error and managed to reproduce it with the following basic test adapted from the Readme example:
the third .add_item fails with:
classifier-reborn-2.0.2/lib/classifier-reborn/lsi.rb:284:in `sort': comparison of Float with Float failed (ArgumentError)
Anything I'm doing wrong?
Thanks
The text was updated successfully, but these errors were encountered: