Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 29452 invoked from network); 15 Mar 2011 12:33:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Mar 2011 12:33:53 -0000 Received: (qmail 42446 invoked by uid 500); 15 Mar 2011 12:33:53 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 42385 invoked by uid 500); 15 Mar 2011 12:33:53 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 42376 invoked by uid 99); 15 Mar 2011 12:33:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2011 12:33:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Mar 2011 12:33:51 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 85A2D3AAA50 for ; Tue, 15 Mar 2011 12:33:29 +0000 (UTC) Date: Tue, 15 Mar 2011 12:33:29 +0000 (UTC) From: "Luc Maisonobe (JIRA)" To: issues@commons.apache.org Message-ID: <891976392.3467.1300192409544.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1390264653.15155.1299905639456.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (MATH-546) Truncation issue in KMeansPlusPlusClusterer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006894#comment-13006894 ] Luc Maisonobe commented on MATH-546: ------------------------------------ The empty cluster strategy is needed regardless of this bug. It may appear with different conditions and is a feature commonly found in clustering implementations. This issue can be marked as resolved if the patch has been applied and works. Thanks to Nate for reporting and fixing the issue, thanks to Gilles for reviewing and applying the patch. > Truncation issue in KMeansPlusPlusClusterer > ------------------------------------------- > > Key: MATH-546 > URL: https://issues.apache.org/jira/browse/MATH-546 > Project: Commons Math > Issue Type: Bug > Affects Versions: 3.0 > Reporter: Nate Paymer > Priority: Minor > Labels: cluster > Attachments: MATH-546.txt > > > The for loop inside KMeansPlusPlusClusterer.chooseInitialClusters defines a variable > int sum = 0; > This variable should have type double, rather than int. Using an int causes the method to truncate the distances between points to (square roots of) integers. It's especially bad when the distances between points are typically less than 1. > As an aside, in version 2.2, this bug manifested itself by making the clusterer return empty clusters. I wonder if the EmptyClusterStrategy would still be necessary if this bug were fixed. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira