[jira] Created: (MATH-436) KMeansPlusPlusClusterer Exception when clusters>variables

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (MATH-436) KMeansPlusPlusClusterer Exception when clusters>variables

ASF GitHub Bot (Jira)
KMeansPlusPlusClusterer Exception when clusters>variables
---------------------------------------------------------

                 Key: MATH-436
                 URL: https://issues.apache.org/jira/browse/MATH-436
             Project: Commons Math
          Issue Type: Wish
    Affects Versions: 3.0
            Reporter: Erik van Ingen
            Priority: Minor
             Fix For: 3.0


It would be nice when KMeansPlusPlusClusterer generates an exception when the number of cluster is larger than the number of variables.

KMeansPlusPlusClustererTest:
 /**
     * 2 variables cannot be clustered into 3 clusters.
     */
    @Test
    public void testPerformClusterAnalysisToManyClusters() {
        KMeansPlusPlusClusterer<EuclideanIntegerPoint> transformer = new KMeansPlusPlusClusterer<EuclideanIntegerPoint>(
                new Random(1746432956321l));
        EuclideanIntegerPoint[] points = new EuclideanIntegerPoint[] {
                new EuclideanIntegerPoint(new int[] { 1959, 325100 }),
                new EuclideanIntegerPoint(new int[] { 1960, 373200 }), };
        try {
            transformer.cluster(Arrays.asList(points), 3, 1);
            Assert.fail();
        } catch (Exception e) {
            // 2 variables cannot be clustered into 3 clusters.
        }
    }


--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (MATH-436) KMeansPlusPlusClusterer Exception when clusters>variables

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/MATH-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Thomas Neidhart updated MATH-436:
---------------------------------

    Attachment: MATH-436.patch

patch for MATH-436 wish.

> KMeansPlusPlusClusterer Exception when clusters>variables
> ---------------------------------------------------------
>
>                 Key: MATH-436
>                 URL: https://issues.apache.org/jira/browse/MATH-436
>             Project: Commons Math
>          Issue Type: Wish
>    Affects Versions: 3.0
>            Reporter: Erik van Ingen
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: MATH-436.patch
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> It would be nice when KMeansPlusPlusClusterer generates an exception when the number of cluster is larger than the number of variables.
> KMeansPlusPlusClustererTest:
>  /**
>      * 2 variables cannot be clustered into 3 clusters.
>      */
>     @Test
>     public void testPerformClusterAnalysisToManyClusters() {
>         KMeansPlusPlusClusterer<EuclideanIntegerPoint> transformer = new KMeansPlusPlusClusterer<EuclideanIntegerPoint>(
>                 new Random(1746432956321l));
>         EuclideanIntegerPoint[] points = new EuclideanIntegerPoint[] {
>                 new EuclideanIntegerPoint(new int[] { 1959, 325100 }),
>                 new EuclideanIntegerPoint(new int[] { 1960, 373200 }), };
>         try {
>             transformer.cluster(Arrays.asList(points), 3, 1);
>             Assert.fail();
>         } catch (Exception e) {
>             // 2 variables cannot be clustered into 3 clusters.
>         }
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Resolved] (MATH-436) KMeansPlusPlusClusterer Exception when clusters>variables

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/MATH-436?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Luc Maisonobe resolved MATH-436.
--------------------------------

    Resolution: Fixed

Fixed in subversion repository as of r1084577.

Thanks for the patch

> KMeansPlusPlusClusterer Exception when clusters>variables
> ---------------------------------------------------------
>
>                 Key: MATH-436
>                 URL: https://issues.apache.org/jira/browse/MATH-436
>             Project: Commons Math
>          Issue Type: Wish
>    Affects Versions: 3.0
>            Reporter: Erik van Ingen
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: MATH-436.patch
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> It would be nice when KMeansPlusPlusClusterer generates an exception when the number of cluster is larger than the number of variables.
> KMeansPlusPlusClustererTest:
>  /**
>      * 2 variables cannot be clustered into 3 clusters.
>      */
>     @Test
>     public void testPerformClusterAnalysisToManyClusters() {
>         KMeansPlusPlusClusterer<EuclideanIntegerPoint> transformer = new KMeansPlusPlusClusterer<EuclideanIntegerPoint>(
>                 new Random(1746432956321l));
>         EuclideanIntegerPoint[] points = new EuclideanIntegerPoint[] {
>                 new EuclideanIntegerPoint(new int[] { 1959, 325100 }),
>                 new EuclideanIntegerPoint(new int[] { 1960, 373200 }), };
>         try {
>             transformer.cluster(Arrays.asList(points), 3, 1);
>             Assert.fail();
>         } catch (Exception e) {
>             // 2 variables cannot be clustered into 3 clusters.
>         }
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (MATH-436) KMeansPlusPlusClusterer Exception when clusters>variables

ASF GitHub Bot (Jira)
In reply to this post by ASF GitHub Bot (Jira)

    [ https://issues.apache.org/jira/browse/MATH-436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010114#comment-13010114 ]

Erik van Ingen commented on MATH-436:
-------------------------------------

Excellent, thank you very much for having followed up on this.

> KMeansPlusPlusClusterer Exception when clusters>variables
> ---------------------------------------------------------
>
>                 Key: MATH-436
>                 URL: https://issues.apache.org/jira/browse/MATH-436
>             Project: Commons Math
>          Issue Type: Wish
>    Affects Versions: 3.0
>            Reporter: Erik van Ingen
>            Priority: Minor
>             Fix For: 3.0
>
>         Attachments: MATH-436.patch
>
>   Original Estimate: 0.25h
>  Remaining Estimate: 0.25h
>
> It would be nice when KMeansPlusPlusClusterer generates an exception when the number of cluster is larger than the number of variables.
> KMeansPlusPlusClustererTest:
>  /**
>      * 2 variables cannot be clustered into 3 clusters.
>      */
>     @Test
>     public void testPerformClusterAnalysisToManyClusters() {
>         KMeansPlusPlusClusterer<EuclideanIntegerPoint> transformer = new KMeansPlusPlusClusterer<EuclideanIntegerPoint>(
>                 new Random(1746432956321l));
>         EuclideanIntegerPoint[] points = new EuclideanIntegerPoint[] {
>                 new EuclideanIntegerPoint(new int[] { 1959, 325100 }),
>                 new EuclideanIntegerPoint(new int[] { 1960, 373200 }), };
>         try {
>             transformer.cluster(Arrays.asList(points), 3, 1);
>             Assert.fail();
>         } catch (Exception e) {
>             // 2 variables cannot be clustered into 3 clusters.
>         }
>     }

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira