org.apache.spark.mllib.regression
Class GeneralizedLinearAlgorithm<M extends GeneralizedLinearModel>

Object
  extended by org.apache.spark.mllib.regression.GeneralizedLinearAlgorithm<M>
All Implemented Interfaces:
java.io.Serializable, Logging
Direct Known Subclasses:
LassoWithSGD, LinearRegressionWithSGD, LogisticRegressionWithLBFGS, LogisticRegressionWithSGD, RidgeRegressionWithSGD, SVMWithSGD

public abstract class GeneralizedLinearAlgorithm<M extends GeneralizedLinearModel>
extends Object
implements Logging, scala.Serializable

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

See Also:
Serialized Form

Constructor Summary
GeneralizedLinearAlgorithm()
           
 
Method Summary
 int getNumFeatures()
          The dimension of training features.
 boolean isAddIntercept()
          Get if the algorithm uses addIntercept
abstract  Optimizer optimizer()
          The optimizer to solve the problem.
 M run(RDD<LabeledPoint> input)
          Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries.
 M run(RDD<LabeledPoint> input, Vector initialWeights)
          Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries starting from the initial weights provided.
 GeneralizedLinearAlgorithm<M> setIntercept(boolean addIntercept)
          Set if the algorithm should add an intercept.
 GeneralizedLinearAlgorithm<M> setValidateData(boolean validateData)
          Set if the algorithm should validate data before training.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.spark.Logging
initializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarning
 

Constructor Detail

GeneralizedLinearAlgorithm

public GeneralizedLinearAlgorithm()
Method Detail

optimizer

public abstract Optimizer optimizer()
The optimizer to solve the problem.


getNumFeatures

public int getNumFeatures()
The dimension of training features.

Returns:
(undocumented)

isAddIntercept

public boolean isAddIntercept()
Get if the algorithm uses addIntercept

Returns:
(undocumented)

setIntercept

public GeneralizedLinearAlgorithm<M> setIntercept(boolean addIntercept)
Set if the algorithm should add an intercept. Default false. We set the default to false because adding the intercept will cause memory allocation.

Parameters:
addIntercept - (undocumented)
Returns:
(undocumented)

setValidateData

public GeneralizedLinearAlgorithm<M> setValidateData(boolean validateData)
Set if the algorithm should validate data before training. Default true.

Parameters:
validateData - (undocumented)
Returns:
(undocumented)

run

public M run(RDD<LabeledPoint> input)
Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries.

Parameters:
input - (undocumented)
Returns:
(undocumented)

run

public M run(RDD<LabeledPoint> input,
             Vector initialWeights)
Run the algorithm with the configured parameters on an input RDD of LabeledPoint entries starting from the initial weights provided.

Parameters:
input - (undocumented)
initialWeights - (undocumented)
Returns:
(undocumented)