org.encog.util.kmeans

## Class KMeansUtil<K extends CentroidFactory<? super K>>

- java.lang.Object
- - org.encog.util.kmeans.KMeansUtil<K>

- Type Parameters:
    `K` - The type to cluster.

      public class KMeansUtil<K extends CentroidFactory<? super K>>
      extends Object

  Generic KMeans clustering object.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KMeansUtil(int theK, List<? extends K> theElements)` Construct the clusters.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Collection<K>` | `get(int index)` Get a cluster by index.
    `Cluster<K>` | `getCluster(int i)` Get a cluster by index.
    `void` | `process()` Perform the cluster.
    `int` | `size()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KMeansUtil

          public KMeansUtil(int theK,
                    List<? extends K> theElements)

      Construct the clusters. Call process to perform the cluster.
      Parameters:
        `theK` - The number of clusters.
        `theElements` - The elements to cluster.

  - ### Method Detail

    - #### process

          public void process()

      Perform the cluster.

    - #### get

          public Collection<K> get(int index)

      Get a cluster by index.
      Parameters:
        `index` - The index to get.
      Returns:
        The cluster.

    - #### size

          public int size()

      Returns:
        The number of clusters.

    - #### getCluster

          public Cluster<K> getCluster(int i)

      Get a cluster by index.
      Parameters:
        `i` - The index to get.
      Returns:
        The cluster.

Copyright © 2014. All Rights Reserved.