Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 50997 invoked from network); 4 Apr 2011 10:59:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Apr 2011 10:59:52 -0000 Received: (qmail 19959 invoked by uid 500); 4 Apr 2011 10:59:50 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 18973 invoked by uid 500); 4 Apr 2011 10:59:49 -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 18965 invoked by uid 99); 4 Apr 2011 10:59:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Apr 2011 10:59:49 +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; Mon, 04 Apr 2011 10:59:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E88A89132C for ; Mon, 4 Apr 2011 10:59:05 +0000 (UTC) Date: Mon, 4 Apr 2011 10:59:05 +0000 (UTC) From: "Gilles (JIRA)" To: issues@commons.apache.org Message-ID: <1726710648.32168.1301914745949.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2117381816.15160.1299906359612.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-547) KMeansPlusPlusClusterer should not call equals() 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-547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13015351#comment-13015351 ] Gilles commented on MATH-547: ----------------------------- I'm not familiar with the code; so please go ahead with the changes if they are satisfactory to you. > KMeansPlusPlusClusterer should not call equals() > ------------------------------------------------ > > Key: MATH-547 > URL: https://issues.apache.org/jira/browse/MATH-547 > Project: Commons Math > Issue Type: Improvement > Affects Versions: 3.0 > Reporter: Nate Paymer > Priority: Minor > Attachments: MATH-547.patch > > > In determining whether the clusters have changed between iterations, the KMeansPlusPlusClusterer currently calls equals to determine whether the cluster centers have changed. It would be better to avoid relying on equals by instead checking whether any points have moved between clusters. > equals can be problematic because floating point operations are not strictly commutative or associative, so getCentroid may return slightly different values even when called with the same set of inputs. Additionally, the client may choose not to override equals at all, since it's not clear that it's required. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira