Packages

c

org.apache.spark.mllib.regression

StreamingLinearAlgorithm

abstract class StreamingLinearAlgorithm[M <: GeneralizedLinearModel, A <: GeneralizedLinearAlgorithm[M]] extends Logging

StreamingLinearAlgorithm implements methods for continuously training a generalized linear model on streaming data, and using it for prediction on (possibly different) streaming data.

This class takes as type parameters a GeneralizedLinearModel, and a GeneralizedLinearAlgorithm, making it easy to extend to construct streaming versions of any analyses using GLMs. Initial weights must be set before calling trainOn or predictOn. Only weights will be updated, not an intercept. If the model needs an intercept, it should be manually appended to the input data.

For example usage, see StreamingLinearRegressionWithSGD.

NOTE: In some use cases, the order in which trainOn and predictOn are called in an application will affect the results. When called on the same DStream, if trainOn is called before predictOn, when new data arrive the model will update and the prediction will be based on the new model. Whereas if predictOn is called first, the prediction will use the model from the previous update.

NOTE: It is ok to call predictOn repeatedly on multiple streams; this will generate predictions for each one all using the current model. It is also ok to call trainOn on different streams; this will update the model using each of the different sources, in sequence.

Annotations
@Since( "1.1.0" )
Source
StreamingLinearAlgorithm.scala
Linear Supertypes
Logging, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. StreamingLinearAlgorithm
  2. Logging
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new StreamingLinearAlgorithm()

Abstract Value Members

  1. abstract val algorithm: A

    The algorithm to use for updating.

    The algorithm to use for updating.

    Attributes
    protected
  2. abstract val model: Option[M]

    The model to be updated and used for prediction.

    The model to be updated and used for prediction.

    Attributes
    protected

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @IntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. def initializeLogIfNecessary(isInterpreter: Boolean, silent: Boolean): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  11. def initializeLogIfNecessary(isInterpreter: Boolean): Unit
    Attributes
    protected
    Definition Classes
    Logging
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def isTraceEnabled(): Boolean
    Attributes
    protected
    Definition Classes
    Logging
  14. def latestModel(): M

    Return the latest model.

    Return the latest model.

    Annotations
    @Since( "1.1.0" )
  15. def log: Logger
    Attributes
    protected
    Definition Classes
    Logging
  16. def logDebug(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  17. def logDebug(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  18. def logError(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  19. def logError(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  20. def logInfo(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  21. def logInfo(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  22. def logName: String
    Attributes
    protected
    Definition Classes
    Logging
  23. def logTrace(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  24. def logTrace(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  25. def logWarning(msg: ⇒ String, throwable: Throwable): Unit
    Attributes
    protected
    Definition Classes
    Logging
  26. def logWarning(msg: ⇒ String): Unit
    Attributes
    protected
    Definition Classes
    Logging
  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  29. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  30. def predictOn(data: JavaDStream[Vector]): JavaDStream[Double]

    Java-friendly version of predictOn.

    Java-friendly version of predictOn.

    Annotations
    @Since( "1.3.0" )
  31. def predictOn(data: DStream[Vector]): DStream[Double]

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

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

    data

    DStream containing feature vectors

    returns

    DStream containing predictions

    Annotations
    @Since( "1.1.0" )
  32. def predictOnValues[K](data: JavaPairDStream[K, Vector]): JavaPairDStream[K, Double]

    Java-friendly version of predictOnValues.

    Java-friendly version of predictOnValues.

    Annotations
    @Since( "1.3.0" )
  33. def predictOnValues[K](data: DStream[(K, Vector)])(implicit arg0: ClassTag[K]): DStream[(K, Double)]

    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 feature vectors

    returns

    DStream containing the input keys and the predictions as values

    Annotations
    @Since( "1.1.0" )
  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. def trainOn(data: JavaDStream[LabeledPoint]): Unit

    Java-friendly version of trainOn.

    Java-friendly version of trainOn.

    Annotations
    @Since( "1.3.0" )
  37. def trainOn(data: DStream[LabeledPoint]): Unit

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

    Update the model by training on batches of data from a DStream. This operation registers a DStream for training the model, and updates the model based on every subsequent batch of data from the stream.

    data

    DStream containing labeled data

    Annotations
    @Since( "1.1.0" )
  38. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  40. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from Logging

Inherited from AnyRef

Inherited from Any

Ungrouped