org.apache.spark.mllib.optimization
Compute an updated value for weights given the gradient, stepSize, iteration number and regularization parameter.
Compute an updated value for weights given the gradient, stepSize, iteration number and regularization parameter. Also returns the regularization value computed using the *updated* weights.
- Column matrix of size nx1 where n is the number of features.
- Column matrix of size nx1 where n is the number of features.
- step size across iterations
- Iteration number
- Regularization parameter
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.
Updater that adjusts learning rate and performs L1 regularization.
The corresponding proximal operator used is the soft-thresholding function. That is, each weight component is shrunk towards 0 by shrinkageVal.
If w > shrinkageVal, set weight component to w-shrinkageVal. If w < -shrinkageVal, set weight component to w+shrinkageVal. If -shrinkageVal < w < shrinkageVal, set weight component to 0.
Equivalently, set weight component to signum(w) * max(0.0, abs(w) - shrinkageVal)