Class/Object

clustering4ever.scala.clustering.kmeans

KMeans

Related Docs: object KMeans | package kmeans

Permalink

class KMeans[ID, O, V <: Seq[Double], Cz[ID, O, V <: Seq[Double]] <: RealClusterizable[ID, O, V, Cz[ID, O, V]], D <: ContinuousDistance[V]] extends KCommonsVectors[ID, Double, V, D, Cz[ID, O, V]]

The famous K-Means using a user-defined dissmilarity measure.

Linear Supertypes
KCommonsVectors[ID, Double, V, D, Cz[ID, O, V]], KCommonsScala[ID, V, D, Cz[ID, O, V]], KCommons[ID, V, D], ClusteringAlgorithms[ID], Serializable, Serializable, DataSetsTypes[ID], ClusteringCommons, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. KMeans
  2. KCommonsVectors
  3. KCommonsScala
  4. KCommons
  5. ClusteringAlgorithms
  6. Serializable
  7. Serializable
  8. DataSetsTypes
  9. ClusteringCommons
  10. AnyRef
  11. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new KMeans(data: GenSeq[Cz[ID, O, V]], k: Int, epsilon: Double, maxIterations: Int, metric: D = new Euclidean[V](squareRoot = true), initializedCenters: HashMap[Int, V] = mutable.HashMap.empty[Int, V])(implicit arg0: Numeric[ID], arg1: ClassTag[V])

    Permalink

    data

    : preferably and ArrayBuffer or ParArray of Clusterizable

    k

    : number of clusters

    epsilon

    : minimal threshold under which we consider a centroid has converged

    maxIterations

    : maximal number of iteration

    metric

    : a defined dissimilarity measure, it can be custom by overriding ContinuousDistance distance function

Type Members

  1. type ClusterID = Int

    Permalink
    Definition Classes
    ClusteringCommons
  2. type ID = ID

    Permalink
    Definition Classes
    DataSetsTypes

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def areCentersMovingEnough(kCentersBeforeUpdate: HashMap[Int, V], centers: HashMap[Int, V], epsilon: Double): Boolean

    Permalink

    Check if centers move enough

    Check if centers move enough

    returns

    true if every centers move less than epsilon

    Attributes
    protected
    Definition Classes
    KCommons
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val centers: HashMap[Int, V]

    Permalink
    Definition Classes
    KCommonsScala
  7. val centersCardinality: HashMap[Int, Int]

    Permalink
    Definition Classes
    KCommonsScala
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def clusterizedAndSaveCenters(vectorizedDataset: GenSeq[V], centers: HashMap[Int, V]): (GenSeq[(V, Int)], HashMap[Int, V])

    Permalink

    Attributes
    protected
    Definition Classes
    KCommons
  10. def clusterizedAndSaveCentersWithResetingCentersCardinalities(centers: HashMap[Int, V], centersCardinality: HashMap[Int, Int]): (GenSeq[(V, Int)], HashMap[Int, V])

    Permalink
    Attributes
    protected
    Definition Classes
    KCommonsScala
  11. val dim: Int

    Permalink
    Attributes
    protected
    Definition Classes
    KCommonsVectors
  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. lazy val kmppInitialization: (GenSeq[V], Int) ⇒ HashMap[Int, V]

    Permalink

    Kmeans++ initialization

    Kmeans++ initialization

    References

    • Tapas Kanungo, David M. Mount, Nathan S. Netanyahu, Christine D. Piatko, Ruth Silverman, and Angela Y. Wu. An Efficient k-Means Clustering Algorithm: Analysis and Implementation. IEEE TRANS. PAMI, 2002.
    • D. Arthur and S. Vassilvitskii. "K-means++: the advantages of careful seeding". ACM-SIAM symposium on Discrete algorithms, 1027-1035, 2007.
    • Anna D. Peterson, Arka P. Ghosh and Ranjan Maitra. A systematic evaluation of different methods for initializing the K-means clustering algorithm. 2010.
    Definition Classes
    KCommons
  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  22. def obtainMedoid(gs: GenSeq[V]): V

    Permalink

    Compute the similarity matrix and extract point which is the closest from all other point according to its dissimilarity measure

    Compute the similarity matrix and extract point which is the closest from all other point according to its dissimilarity measure

    Attributes
    protected
    Definition Classes
    KCommons
  23. def obtainNearestCenterID(v: V, centers: HashMap[Int, V]): ClusterID

    Permalink

    Attributes
    protected
    Definition Classes
    KCommons
  24. def removeEmptyClusters(centers: HashMap[Int, V], kCentersBeforeUpdate: HashMap[Int, V], centersCardinality: HashMap[Int, Int]): Unit

    Permalink

    Check if there are empty centers and remove them

    Check if there are empty centers and remove them

    Attributes
    protected
    Definition Classes
    KCommons
  25. def removeEmptyClustersAndCheckIfallCentersHaveConverged(centers: HashMap[Int, V], kCentersBeforeUpdate: HashMap[Int, V], centersCardinality: HashMap[Int, Int], epsilon: Double): Boolean

    Permalink
    Attributes
    protected
    Definition Classes
    KCommons
  26. def resetCentersCardinality(centersCardinality: HashMap[Int, Int]): Unit

    Permalink

    Reinitialization of cardinalities

    Reinitialization of cardinalities

    Attributes
    protected
    Definition Classes
    KCommons
  27. def run(): KMeansModel[ID, O, V, Cz[ID, O, V], D]

    Permalink

    Run the K-Means

    Run the K-Means

    Definition Classes
    KMeans → ClusteringAlgorithms
  28. def runKAlgorithmWithCustomMetric(maxIterations: Int, epsilon: Double): Unit

    Permalink
    Attributes
    protected
    Definition Classes
    KCommonsScala
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  31. def updateCentersAndCardinalitiesCustom(clusterized: GenSeq[(V, Int)], centers: HashMap[Int, V], centersCardinality: HashMap[Int, Int]): Unit

    Permalink

    Update Center and Cardinalities

    Update Center and Cardinalities

    Attributes
    protected
    Definition Classes
    KCommonsScala
  32. val vectorizedDataset: GenSeq[V]

    Permalink
    Definition Classes
    KCommonsScala
  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from KCommonsVectors[ID, Double, V, D, Cz[ID, O, V]]

Inherited from KCommonsScala[ID, V, D, Cz[ID, O, V]]

Inherited from KCommons[ID, V, D]

Inherited from ClusteringAlgorithms[ID]

Inherited from Serializable

Inherited from Serializable

Inherited from DataSetsTypes[ID]

Inherited from ClusteringCommons

Inherited from AnyRef

Inherited from Any

Ungrouped