case class Cluster(c: Int = Cluster.next (), np: Int = 0) extends Error with Product with Serializable

The Cluster case class maintains information about clusters, the cluster id, center/centroid, cluster size, and measure of error. Note: the cluster assignment function as an array 'to_c' indicates how points are assigned to clusters.

c

the cluster id

np

the number of points in the cluster (size)

See also

package.scala for the definition of the 'distance' method

Linear Supertypes
Serializable, Product, Equals, Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Cluster
  2. Serializable
  3. Product
  4. Equals
  5. Error
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Cluster(c: Int = Cluster.next (), np: Int = 0)

    c

    the cluster id

    np

    the number of points in the cluster (size)

Value Members

  1. val c: Int
  2. def cen: VectoD

    Return the stored centroid for this cluster.

  3. def cenf(x: MatriD, to_c: Array[Int]): VectoD

    Calculate the centroid for this cluster.

    Calculate the centroid for this cluster.

    x

    the data matrix where each row is a data point

    to_c

    the data point assignment function

  4. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  5. var np: Int
  6. def productElementNames: Iterator[String]
    Definition Classes
    Product
  7. def set_cen(cn: VectoD): Unit

    Set the centroid for this cluster.

    Set the centroid for this cluster.

    cn

    the calculated centroid

  8. def set_sse(ss: Double): Unit

    Set the sum of squared error for this cluster.

    Set the sum of squared error for this cluster.

    ss

    the calculated sum of squared errors

  9. def sse: Double

    Return the stored sum of squared errors for this cluster.

  10. def ssef(x: MatriD, to_c: Array[Int], cn: VectoD = cen): Double

    Calculate the sum of squared errors for this cluster.

    Calculate the sum of squared errors for this cluster.

    x

    the data matrix where each row is a data point

    to_c

    the data point assignment function

    cn

    the hypothetical centroid (defaults to current centroid)