forum.alglib.net

ALGLIB forum
It is currently Mon Dec 23, 2024 12:51 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: k-Means infinite loop in extreme corner cases
PostPosted: Wed Sep 05, 2012 1:13 pm 
Offline

Joined: Wed Sep 05, 2012 12:59 pm
Posts: 2
I have a situation where kmeansgenerate seems to be stuck in an infinite loop (C# version of alglib 3.6.0). The parameters are as follows (copied from the debugger):

xy: {double[57, 1]}
[0, 0]: 12.244689632138986
[1, 0]: 12.244689632138982
[2, 0]: 12.244689632138986
[3, 0]: 12.244689632138982
[4, 0]: 12.244689632138986
[5, 0]: 12.244689632138986
[6, 0]: 12.244689632138986
[7, 0]: 12.244689632138986
[8, 0]: 12.244689632138986
[9, 0]: 12.244689632138986
[10, 0]: 12.244689632138989
[11, 0]: 12.244689632138984
[12, 0]: 12.244689632138986
[13, 0]: 12.244689632138986
[14, 0]: 12.244689632138989
[15, 0]: 12.244689632138986
[16, 0]: 12.244689632138986
[17, 0]: 12.244689632138986
[18, 0]: 12.244689632138986
[19, 0]: 12.244689632138989
[20, 0]: 12.244689632138972
[21, 0]: 12.244689632138986
[22, 0]: 12.244689632138986
[23, 0]: 12.244689632138986
[24, 0]: 12.244689632138984
[25, 0]: 12.244689632138982
[26, 0]: 12.244689632138986
[27, 0]: 12.244689632138986
[28, 0]: 12.244689632138986
[29, 0]: 12.244689632138986
[30, 0]: 12.244689632138986
[31, 0]: 12.244689632138986
[32, 0]: 12.244689632138986
[33, 0]: 12.244689632138986
[34, 0]: 12.244689632138986
[35, 0]: 12.244689632138982
[36, 0]: 12.244689632138989
[37, 0]: 12.244689632138986
[38, 0]: 12.244689632138986
[39, 0]: 12.244689632138986
[40, 0]: 12.244689632138986
[41, 0]: 12.244689632138986
[42, 0]: 12.244689632138986
[43, 0]: 12.244689632138986
[44, 0]: 12.244689632138986
[45, 0]: 12.244689632138986
[46, 0]: 12.244689632138986
[47, 0]: 12.244689632138986
[48, 0]: 12.244689632138986
[49, 0]: 12.244689632138986
[50, 0]: 12.244689632138984
[51, 0]: 12.244689632138986
[52, 0]: 12.244689632138986
[53, 0]: 12.244689632138986
[54, 0]: 12.244689632138986
[55, 0]: 12.244689632138986
[56, 0]: 12.244689632138986

nPoints: 57
nVars: 1
k: 4
restarts: 1

Can you reproduce this situation?

I understand that this doesn't really constitute "good data", but unfortunately, I don't have a lot of control on the input values, they can be as meaningless as in this case. Currently I'm just filtering when there are less distinct values than clusters. I'm probably changing this to require some higher minimum range between the values and hope to avoid such situations.

I'm running the program in Vista 64bit and use VS2010 and .Net 4.


Top
 Profile  
 
 Post subject: Re: k-Means infinite loop in extreme corner cases
PostPosted: Thu Sep 06, 2012 5:51 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Hello!

Thanks for the report, I've added this issue to bug tracker, see http://bugs.alglib.net/view.php?id=487 for the record. You are right - your situation is degenerate, but you are also right when you report it as bug - good algorithm should work with any data. Or, at least, fail with error report.

I've not tried to reproduce it yet, I think that I will move to this issue at Friday. In my opinion, fix won't need too much time. There should be some easy solution to prevent infinite loops like this.


Top
 Profile  
 
 Post subject: Re: k-Means infinite loop in extreme corner cases
PostPosted: Fri Sep 07, 2012 9:23 am 
Offline

Joined: Wed Sep 05, 2012 12:59 pm
Posts: 2
Thank you Sergey! Just to let you know this fix is not time-critical for me as I have moved on and implemented Ckmeans.1d.dp by Wang and Song. Anyway, as you say, it would be good if this was fixed in a future version.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group