org.apache.spark.mllib

regression

package regression

Visibility
  1. Public
  2. All

Type Members

  1. abstract class GeneralizedLinearAlgorithm[M <: GeneralizedLinearModel] extends Logging with Serializable

    :: DeveloperApi :: GeneralizedLinearAlgorithm implements methods to train a Generalized Linear Model (GLM).

    :: DeveloperApi :: GeneralizedLinearAlgorithm implements methods to train a Generalized Linear Model (GLM). This class should be extended with an Optimizer to create a new GLM.

    Annotations
    @DeveloperApi()
  2. abstract class GeneralizedLinearModel extends Serializable

    :: DeveloperApi :: GeneralizedLinearModel (GLM) represents a model trained using GeneralizedLinearAlgorithm.

    :: DeveloperApi :: GeneralizedLinearModel (GLM) represents a model trained using GeneralizedLinearAlgorithm. GLMs consist of a weight vector and an intercept.

    Annotations
    @DeveloperApi()
  3. case class LabeledPoint(label: Double, features: Vector) extends Product with Serializable

    Class that represents the features and labels of a data point.

    Class that represents the features and labels of a data point.

    label

    Label for this data point.

    features

    List of features for this data point.

    Annotations
    @BeanInfo()
  4. class LassoModel extends GeneralizedLinearModel with RegressionModel with Serializable

    Regression model trained using Lasso.

  5. class LassoWithSGD extends GeneralizedLinearAlgorithm[LassoModel] with Serializable

    Train a regression model with L1-regularization using Stochastic Gradient Descent.

    Train a regression model with L1-regularization using Stochastic Gradient Descent. This solves the l1-regularized least squares regression formulation f(weights) = 1/n ||A weights-y||^2 + regParam ||weights||_1 Here the data matrix has n rows, and the input RDD holds the set of rows of A, each with its corresponding right hand side label y. See also the documentation for the precise formulation.

  6. class LinearRegressionModel extends GeneralizedLinearModel with RegressionModel with Serializable

    Regression model trained using LinearRegression.

  7. class LinearRegressionWithSGD extends GeneralizedLinearAlgorithm[LinearRegressionModel] with Serializable

    Train a linear regression model with no regularization using Stochastic Gradient Descent.

    Train a linear regression model with no regularization using Stochastic Gradient Descent. This solves the least squares regression formulation f(weights) = 1/n ||A weights-y||^2 (which is the mean squared error). Here the data matrix has n rows, and the input RDD holds the set of rows of A, each with its corresponding right hand side label y. See also the documentation for the precise formulation.

  8. trait RegressionModel extends Serializable

    Annotations
    @Experimental()
  9. class RidgeRegressionModel extends GeneralizedLinearModel with RegressionModel with Serializable

    Regression model trained using RidgeRegression.

  10. class RidgeRegressionWithSGD extends GeneralizedLinearAlgorithm[RidgeRegressionModel] with Serializable

    Train a regression model with L2-regularization using Stochastic Gradient Descent.

    Train a regression model with L2-regularization using Stochastic Gradient Descent. This solves the l1-regularized least squares regression formulation f(weights) = 1/n ||A weights-y||2 + regParam/2 ||weights||2 Here the data matrix has n rows, and the input RDD holds the set of rows of A, each with its corresponding right hand side label y. See also the documentation for the precise formulation.

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

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

    :: DeveloperApi :: StreamingLinearAlgorithm implements methods for continuously training a generalized linear model 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(Freeman): 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(Freeman): 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
    @DeveloperApi()
  12. class StreamingLinearRegressionWithSGD extends StreamingLinearAlgorithm[LinearRegressionModel, LinearRegressionWithSGD] with Serializable

    Train or predict a linear regression model on streaming data.

    Train or predict a linear regression model on streaming data. Training uses Stochastic Gradient Descent to update the model based on each new batch of incoming data from a DStream (see LinearRegressionWithSGD for model equation)

    Each batch of data is assumed to be an RDD of LabeledPoints. The number of data points per batch can vary, but the number of features must be constant. An initial weight vector must be provided.

    Use a builder pattern to construct a streaming linear regression analysis in an application, like:

    val model = new StreamingLinearRegressionWithSGD() .setStepSize(0.5) .setNumIterations(10) .setInitialWeights(Vectors.dense(...)) .trainOn(DStream)

    Annotations
    @Experimental()

Value Members

  1. object LabeledPoint extends Serializable

    Parser for org.apache.spark.mllib.regression.LabeledPoint.

  2. object LassoWithSGD extends Serializable

    Top-level methods for calling Lasso.

  3. object LinearRegressionWithSGD extends Serializable

    Top-level methods for calling LinearRegression.

  4. object RidgeRegressionWithSGD extends Serializable

    Top-level methods for calling RidgeRegression.

Ungrouped