Class

com.tencent.angel.ml.clustering.kmeans

KMeansLearner

Related Doc: package kmeans

Permalink

class KMeansLearner extends MLLearner

Kmeans is clustering algorithm, which find the closest center of each instance. This is the learner class of kmeans.

Linear Supertypes
MLLearner, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. KMeansLearner
  2. MLLearner
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new KMeansLearner(ctx: TaskContext)

    Permalink

    ctx

    : context of this task

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. val C: Double

    Permalink
  5. val K: Int

    Permalink
  6. val LOG: Log

    Permalink
  7. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def computeObjValue(dataStorage: DataBlock[LabeledData], epoch: Int): Double

    Permalink

    Compute the objective values of all samples, which is measured by the distance from a sample to its closest center.

    Compute the objective values of all samples, which is measured by the distance from a sample to its closest center.

    dataStorage

    : the trainning dataset

    epoch

    : the epoch number

  10. val conf: Configuration

    Permalink
    Definition Classes
    MLLearner
  11. val ctx: TaskContext

    Permalink

    : context of this task

    : context of this task

    Definition Classes
    KMeansLearnerMLLearner
  12. val epochNum: Int

    Permalink
  13. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. val feaNum: Int

    Permalink
  16. def finalize(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  18. val globalMetrics: GlobalMetrics

    Permalink
    Definition Classes
    MLLearner
  19. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  20. def initKCentersRandomly(dataStorage: DataBlock[LabeledData]): Unit

    Permalink

    Pick up K samples as initial centers randomly, and push them to PS.

    Pick up K samples as initial centers randomly, and push them to PS.

    dataStorage

    : trainning data storage, the cluster center candidates

  21. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  22. val kmeansModel: KMeansModel

    Permalink
  23. def miniBatchUpdation(samples: DataBlock[LabeledData], per_center_step_counts: Array[Int]): Unit

    Permalink

    Upate the centers with a mini batch samples, first find the closest center for each sample.

    Upate the centers with a mini batch samples, first find the closest center for each sample. Second each sample is used to update its closest center using the per-center learning rate.

    samples

    : the samples picked up for mini batch updation

    per_center_step_counts

    : the array sotres the number of samples of each center

  24. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  27. def picInstances(trainData: DataBlock[LabeledData]): DataBlock[LabeledData]

    Permalink

    Pick up #batch_sample_num samples randomly from the trainning data.

  28. val spRatio: Double

    Permalink
  29. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Permalink
    Definition Classes
    AnyRef → Any
  31. def train(trainData: DataBlock[LabeledData], valiData: DataBlock[LabeledData]): MLModel

    Permalink

    Train a KMeans Model

    Train a KMeans Model

    trainData

    : trainning dataset storage

    returns

    : a learned model

    Definition Classes
    KMeansLearnerMLLearner
  32. def trainOneEpoch(epoch: Int, trainData: DataBlock[LabeledData], per_center_step_counts: Array[Int]): Unit

    Permalink

    Each epoch updation is performed in three steps.

    Each epoch updation is performed in three steps. First, pull the centers updated by last epoch from PS. Second, a mini batch of size batch_sample_num is sampled. Third, update the centers in a mini-batch way.

    trainData

    : the trainning data storage

    per_center_step_counts

    : the array caches the number of samples per center

  33. def updateCenters(oldCenters: ArrayList[TIntDoubleVector]): Unit

    Permalink
  34. final def wait(): Unit

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

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

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

Inherited from MLLearner

Inherited from AnyRef

Inherited from Any

Ungrouped