Skip to content
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: can't cluster simple data without ccore=True #407

Closed
Jeff-Tian opened this issue Feb 1, 2018 · 5 comments
Closed

Bug: can't cluster simple data without ccore=True #407

Jeff-Tian opened this issue Feb 1, 2018 · 5 comments
Assignees
Labels
Bug Tasks related to found bugs

Comments

@Jeff-Tian
Copy link

x = xmeans([[0],[0],[10],[10],[20],[20]],[[5],[20]], 20, 0.025)
x.process()

throws: ValueError: math domain error
But if turn on ccore = True, then the result is correct:

x = xmeans([[0],[0],[10],[10],[20],[20]],[[5],[20]], 20, 0.025, ccore=True)
x.process()
@annoviko annoviko self-assigned this Feb 1, 2018
@annoviko annoviko added the Bug Tasks related to found bugs label Feb 1, 2018
@annoviko annoviko added this to To Do in 0.8.0 Optimization via automation Feb 1, 2018
@annoviko
Copy link
Owner

annoviko commented Feb 1, 2018

@Jeff-Tian, thank you for the bug reporting and code example. It's a definitely bug that will be corrected soon.

@annoviko annoviko moved this from To Do to In Progress in 0.8.0 Optimization Feb 1, 2018
annoviko added a commit that referenced this issue Feb 1, 2018
…hm (C/C++ handles this, correction is not required).
annoviko added a commit that referenced this issue Feb 1, 2018
@annoviko
Copy link
Owner

annoviko commented Feb 1, 2018

@Jeff-Tian, I have corrected it on '0.8.dev' branch. It works for 'CCORE' because 'std::log(x)' is able to perform calculation for values that are less or equal to zero:

double value = std::log(0); /* equals to '-inf' */

But it does not work for Python - exception is thrown instead.

@annoviko annoviko moved this from In Progress to Done in 0.8.0 Optimization Feb 1, 2018
@Jeff-Tian
Copy link
Author

Wow, checked it and it works now! Thank you for so quickly turnaround.

@annoviko
Copy link
Owner

annoviko commented Feb 2, 2018

@Jeff-Tian, if you are going to use '0.8.dev' - it a development branch. So, you need to build CCORE by yourself. For linux:

cd pyclustering/ccore
make ccore_x64 # if you are working on x64
make ccore_x86 # if you are working on x86

And for windows using visual studio project 2015: pyclustering\ccore\ccore.sln

Here is an instruction how to do that: https://github.com/annoviko/pyclustering/wiki/Core-of-the-PyClustering

If you faced with problems related to pyclustering, do not hesitate to ask for help.

@Jeff-Tian
Copy link
Author

@annoviko, thank you for the information! Yesterday I just checked out '0.8.dev' branch and run the python version very well. If later I need to build a CCORE I will reference the information you provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Tasks related to found bugs
Projects
No open projects
Development

No branches or pull requests

2 participants