-
Notifications
You must be signed in to change notification settings - Fork 5
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
Bug Report: RuntimeWarning: invalid value encountered in scalar divide #112
Comments
@erkankarabulut, thank you for reporting this bug. Please provide a minimal example that resulted in an exception. We would like to have more information before changing the code. |
Hello @firefly-cpp! Here is a minimal example that will result in the warning message I mentioned:
In this case, feature_max and feature_min will be equal and the divisor part on the lines I mentioned will be equal to 0. I see that |
Thanks @erkankarabulut. Please patch it and submit a pull request. |
@firefly-cpp I wasn't sure how to fix this, but I guess increasing Could you verify this, please? I opened a PR as well: #113. I am not sure how to link PRs to issues. |
The new version is now on Pypi. @erkankarabulut, please check it out and test it. In case of any other bugs, feel free to open a ticket and submit a pull request. By the way, there is also a Julia version: https://github.com/firefly-cpp/NiaARM.jl while there is also an R version, but is very immature: https://github.com/firefly-cpp/niarules |
In
rule.py
, lines 224-226, and 244-246, the following lines throw an error if the divisor part is 0:For instance, if all the values are same in a column, that this lines throws the following warning message:
RuntimeWarning: invalid value encountered in scalar divide acc += (attribute.max_val - attribute.min_val) / (...
The text was updated successfully, but these errors were encountered: