You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Artem Barger (JIRA)" <ji...@apache.org> on 2016/06/02 07:19:59 UTC
[jira] [Commented] (MATH-1374) KMeansPlusPlusClusterer unable to
converge having repeatable points in input dataset
[ https://issues.apache.org/jira/browse/MATH-1374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15311864#comment-15311864 ]
Artem Barger commented on MATH-1374:
------------------------------------
Reporting this bug here, since I'm not 100% sure what is the desirable or correct solution to fix it, for example {{matlab}} and {{octave}} implementation of {{kmeans}} dealing with such situation, by randomly selecting repeated points into new clusters. Also I'm not sure whenever this is a real life scenario one should take care off. I've found it accidentally running some tests on my data.
> 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
>
> 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<DoublePoint> 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<DoublePoint> clusterer = new KMeansPlusPlusClusterer<>(12);
> clusterer.cluster(points);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)