net.returnvoid.analytics

## Interface Cluster

- All Known Implementing Classes:
    ColorCluster

      public interface Cluster

  An interface to build clusters.
  Author:
    Diana Lange

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Cluster` | `addElement(java.lang.Object newMember)` Adds an element to the cluster.
    `java.util.ArrayList<?>` | `getElements()` Returns all cluster members.
    `java.lang.Float` | `getLoss()` Caculates the loss / error of the cluster.
    `java.lang.Object` | `getMean()` Returns the current mean of the cluster.
    `Cluster` | `removeElement(java.lang.Object member)` Removes an element from the cluster (if the given element is a member).
    `boolean` | `switchElement(java.lang.Object member, Cluster newCluster)` The given element member switches to another cluster under certain circumstances.
    `Cluster` | `updateMean()` Updates the mean value based on the current cluster members.

- - ### Method Detail

    - #### addElement

          Cluster addElement(java.lang.Object newMember)

      Adds an element to the cluster.
      Parameters:
        `newMember` - The new cluster member.
      Returns:
        The current cluster object.

    - #### removeElement

          Cluster removeElement(java.lang.Object member)

      Removes an element from the cluster (if the given element is a member).
      Parameters:
        `member` - The element which should be removed.
      Returns:
        The current cluster object.

    - #### switchElement

          boolean switchElement(java.lang.Object member,
                                Cluster newCluster)

      The given element member switches to another cluster under certain circumstances. Returns if the given member actually changed its cluster.
      Parameters:
        `member` - The element which might switch the cluster.
        `newCluster` - The cluster where the element might switch to.
      Returns:
        True, if element has changed its cluster. Otherwise false.

    - #### updateMean

          Cluster updateMean()

      Updates the mean value based on the current cluster members.
      Returns:
        The current cluster object.

    - #### getLoss

          java.lang.Float getLoss()

      Caculates the loss / error of the cluster.
      Returns:
        The error / loss value.

    - #### getMean

          java.lang.Object getMean()

      Returns the current mean of the cluster.
      Returns:
        The cluster's mean.

    - #### getElements

          java.util.ArrayList<?> getElements()

      Returns all cluster members.
      Returns:
        The cluster members.