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
- Alphabetic
- By Inheritance
- Cluster
- Serializable
- Product
- Equals
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Cluster(c: Int = Cluster.next (), np: Int = 0)
- c
the cluster id
- np
the number of points in the cluster (size)
Value Members
- val c: Int
- def cen: VectoD
Return the stored centroid for this cluster.
- 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
- final def flaw(method: String, message: String): Unit
- Definition Classes
- Error
- var np: Int
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- def set_cen(cn: VectoD): Unit
Set the centroid for this cluster.
Set the centroid for this cluster.
- cn
the calculated centroid
- 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
- def sse: Double
Return the stored sum of squared errors for this cluster.
- 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)