public class RidgeRegressionWithSGD extends GeneralizedLinearAlgorithm<RidgeRegressionModel> implements scala.Serializable
| Constructor and Description |
|---|
RidgeRegressionWithSGD()
Construct a RidgeRegression object with default parameters: {stepSize: 1.0, numIterations: 100,
regParam: 0.01, miniBatchFraction: 1.0}.
|
| Modifier and Type | Method and Description |
|---|---|
protected RidgeRegressionModel |
createModel(Vector weights,
double intercept)
Create a model given the weights and intercept
|
GradientDescent |
optimizer()
The optimizer to solve the problem.
|
static RidgeRegressionModel |
train(RDD<LabeledPoint> input,
int numIterations)
Train a RidgeRegression model given an RDD of (label, features) pairs.
|
static RidgeRegressionModel |
train(RDD<LabeledPoint> input,
int numIterations,
double stepSize,
double regParam)
Train a RidgeRegression model given an RDD of (label, features) pairs.
|
static RidgeRegressionModel |
train(RDD<LabeledPoint> input,
int numIterations,
double stepSize,
double regParam,
double miniBatchFraction)
Train a RidgeRegression model given an RDD of (label, features) pairs.
|
static RidgeRegressionModel |
train(RDD<LabeledPoint> input,
int numIterations,
double stepSize,
double regParam,
double miniBatchFraction,
Vector initialWeights)
Train a RidgeRegression model given an RDD of (label, features) pairs.
|
addIntercept, getNumFeatures, isAddIntercept, numFeatures, numOfLinearPredictor, run, run, setIntercept, setValidateData, validateData, validatorsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitializeIfNecessary, initializeLogging, isTraceEnabled, log_, log, logDebug, logDebug, logError, logError, logInfo, logInfo, logName, logTrace, logTrace, logWarning, logWarningpublic RidgeRegressionWithSGD()
public static RidgeRegressionModel train(RDD<LabeledPoint> input, int numIterations, double stepSize, double regParam, double miniBatchFraction, Vector initialWeights)
miniBatchFraction fraction of the data to calculate a stochastic gradient. The weights used
in gradient descent are initialized using the initial weights provided.
input - RDD of (label, array of features) pairs.numIterations - Number of iterations of gradient descent to run.stepSize - Step size to be used for each iteration of gradient descent.regParam - Regularization parameter.miniBatchFraction - Fraction of data to be used per iteration.initialWeights - Initial set of weights to be used. Array should be equal in size to
the number of features in the data.
public static RidgeRegressionModel train(RDD<LabeledPoint> input, int numIterations, double stepSize, double regParam, double miniBatchFraction)
miniBatchFraction fraction of the data to calculate a stochastic gradient.
input - RDD of (label, array of features) pairs.numIterations - Number of iterations of gradient descent to run.stepSize - Step size to be used for each iteration of gradient descent.regParam - Regularization parameter.miniBatchFraction - Fraction of data to be used per iteration.
public static RidgeRegressionModel train(RDD<LabeledPoint> input, int numIterations, double stepSize, double regParam)
input - RDD of (label, array of features) pairs.stepSize - Step size to be used for each iteration of Gradient Descent.regParam - Regularization parameter.numIterations - Number of iterations of gradient descent to run.public static RidgeRegressionModel train(RDD<LabeledPoint> input, int numIterations)
input - RDD of (label, array of features) pairs.numIterations - Number of iterations of gradient descent to run.public GradientDescent optimizer()
GeneralizedLinearAlgorithmoptimizer in class GeneralizedLinearAlgorithm<RidgeRegressionModel>protected RidgeRegressionModel createModel(Vector weights, double intercept)
GeneralizedLinearAlgorithmcreateModel in class GeneralizedLinearAlgorithm<RidgeRegressionModel>weights - (undocumented)intercept - (undocumented)