org.apache.spark.mllib.clustering

StreamingKMeans

class StreamingKMeans extends Logging

:: DeveloperApi :: StreamingKMeans provides methods for configuring a streaming k-means analysis, training the model on streaming, and using the model to make predictions on streaming data. See KMeansModel for details on algorithm and update rules.

Use a builder pattern to construct a streaming k-means analysis in an application, like:

val model = new StreamingKMeans() .setDecayFactor(0.5) .setK(3) .setRandomCenters(5, 100.0) .trainOn(DStream)

Annotations
@DeveloperApi()
Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. StreamingKMeans
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StreamingKMeans()

  2. new StreamingKMeans(k: Int, decayFactor: Double, timeUnit: String)

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

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

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. var decayFactor: Double

  9. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

    Definition Classes
    Any
  15. def isTraceEnabled(): Boolean

    Attributes
    protected
    Definition Classes
    Logging
  16. var k: Int

  17. def latestModel(): StreamingKMeansModel

    Return the latest model.

  18. def log: Logger

    Attributes
    protected
    Definition Classes
    Logging
  19. def logDebug(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  20. def logDebug(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  21. def logError(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  22. def logError(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  23. def logInfo(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  24. def logInfo(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  25. def logName: String

    Attributes
    protected
    Definition Classes
    Logging
  26. def logTrace(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  27. def logTrace(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  28. def logWarning(msg: ⇒ String, throwable: Throwable): Unit

    Attributes
    protected
    Definition Classes
    Logging
  29. def logWarning(msg: ⇒ String): Unit

    Attributes
    protected
    Definition Classes
    Logging
  30. var model: StreamingKMeansModel

    Attributes
    protected
  31. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  34. def predictOn(data: DStream[Vector]): DStream[Int]

    Use the clustering model to make predictions on batches of data from a DStream.

    Use the clustering model to make predictions on batches of data from a DStream.

    data

    DStream containing vector data

    returns

    DStream containing predictions

  35. def predictOnValues[K](data: DStream[(K, Vector)])(implicit arg0: ClassTag[K]): DStream[(K, Int)]

    Use the model to make predictions on the values of a DStream and carry over its keys.

    Use the model to make predictions on the values of a DStream and carry over its keys.

    K

    key type

    data

    DStream containing (key, feature vector) pairs

    returns

    DStream containing the input keys and the predictions as values

  36. def setDecayFactor(a: Double): StreamingKMeans.this.type

    Set the decay factor directly (for forgetful algorithms).

  37. def setHalfLife(halfLife: Double, timeUnit: String): StreamingKMeans.this.type

    Set the half life and time unit ("batches" or "points") for forgetful algorithms.

  38. def setInitialCenters(centers: Array[Vector], weights: Array[Double]): StreamingKMeans.this.type

    Specify initial centers directly.

  39. def setK(k: Int): StreamingKMeans.this.type

    Set the number of clusters.

  40. def setRandomCenters(dim: Int, weight: Double, seed: Long = Utils.random.nextLong): StreamingKMeans.this.type

    Initialize random centers, requiring only the number of dimensions.

    Initialize random centers, requiring only the number of dimensions.

    dim

    Number of dimensions

    weight

    Weight for each center

    seed

    Random seed

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

    Definition Classes
    AnyRef
  42. var timeUnit: String

  43. def toString(): String

    Definition Classes
    AnyRef → Any
  44. def trainOn(data: DStream[Vector]): Unit

    Update the clustering model by training on batches of data from a DStream.

    Update the clustering model by training on batches of data from a DStream. This operation registers a DStream for training the model, checks whether the cluster centers have been initialized, and updates the model using each batch of data from the stream.

    data

    DStream containing vector data

  45. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped