org.apache.spark.mllib.optimization
Class SquaredL2Updater

Object
  extended by org.apache.spark.mllib.optimization.Updater
      extended by org.apache.spark.mllib.optimization.SquaredL2Updater
All Implemented Interfaces:
java.io.Serializable

public class SquaredL2Updater
extends Updater

:: DeveloperApi :: Updater for L2 regularized problems. R(w) = 1/2 ||w||^2 Uses a step-size decreasing with the square root of the number of iterations.

See Also:
Serialized Form

Constructor Summary
SquaredL2Updater()
           
 
Method Summary
 scala.Tuple2<Vector,Object> compute(Vector weightsOld, Vector gradient, double stepSize, int iter, double regParam)
          Compute an updated value for weights given the gradient, stepSize, iteration number and regularization parameter.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SquaredL2Updater

public SquaredL2Updater()
Method Detail

compute

public scala.Tuple2<Vector,Object> compute(Vector weightsOld,
                                           Vector gradient,
                                           double stepSize,
                                           int iter,
                                           double regParam)
Description copied from class: Updater
Compute an updated value for weights given the gradient, stepSize, iteration number and regularization parameter. Also returns the regularization value regParam * R(w) computed using the *updated* weights.

Specified by:
compute in class Updater
Parameters:
weightsOld - - Column matrix of size dx1 where d is the number of features.
gradient - - Column matrix of size dx1 where d is the number of features.
stepSize - - step size across iterations
iter - - Iteration number
regParam - - Regularization parameter

Returns:
A tuple of 2 elements. The first element is a column matrix containing updated weights, and the second element is the regularization value computed using updated weights.