StreamingLinearAlgorithm

class pyspark.mllib.regression.StreamingLinearAlgorithm(model: Optional[pyspark.mllib.regression.LinearModel])

Base class that has to be inherited by any StreamingLinearAlgorithm.

Prevents reimplementation of methods predictOn and predictOnValues.

Methods

latestModel()

Returns the latest model.

predictOn(dstream)

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

predictOnValues(dstream)

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

Methods Documentation

latestModel() → Optional[pyspark.mllib.regression.LinearModel]

Returns the latest model.

predictOn(dstream: DStream[VectorLike]) → DStream[float]

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

Returns
pyspark.streaming.DStream

DStream containing predictions.

predictOnValues(dstream: DStream[Tuple[K, VectorLike]]) → DStream[Tuple[K, float]]

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

Returns
pyspark.streaming.DStream

DStream containing predictions.