Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 336BA200AF5 for ; Thu, 2 Jun 2016 09:45:01 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 277DC160A22; Thu, 2 Jun 2016 07:45:01 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6A125160A00 for ; Thu, 2 Jun 2016 09:45:00 +0200 (CEST) Received: (qmail 50783 invoked by uid 500); 2 Jun 2016 07:44:59 -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 50771 invoked by uid 99); 2 Jun 2016 07:44:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jun 2016 07:44:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 44B6B2C033A for ; Thu, 2 Jun 2016 07:44:59 +0000 (UTC) Date: Thu, 2 Jun 2016 07:44:59 +0000 (UTC) From: "Artem Barger (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (MATH-1374) KMeansPlusPlusClusterer unable to converge having repeatable points in input dataset MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 02 Jun 2016 07:45:01 -0000 [ https://issues.apache.org/jira/browse/MATH-1374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Artem Barger updated MATH-1374: ------------------------------- Attachment: MATH-1374.patch Proposed fix which deals w/ the problem. > KMeansPlusPlusClusterer unable to converge having repeatable points in input dataset > ------------------------------------------------------------------------------------ > > Key: MATH-1374 > URL: https://issues.apache.org/jira/browse/MATH-1374 > Project: Commons Math > Issue Type: Bug > Reporter: Artem Barger > Attachments: MATH-1374.patch > > > If the input list size of {{Clusterable}} is greater than parameter {{k}} while has less unique points than {{k}}, the algorithm will fail to converge, tested w/ different EmptyClusterStrategy options, here is the example of default one: > {code} > @Test > public void testNumberOfRequestedClustersSameAsInputSize() { > final RandomVectorGenerator rng = new UncorrelatedRandomVectorGenerator(10, > new GaussianRandomGenerator(RandomSource.create(RandomSource.MT))); > List points = new ArrayList<>(); > for (int i = 0; i < 10; i++) { > final DoublePoint point = new DoublePoint(rng.nextVector()); > for (int j = 0; j < 3; j++) { > points.add(point); > } > } > final KMeansPlusPlusClusterer clusterer = new KMeansPlusPlusClusterer<>(12); > clusterer.cluster(points); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)