Description Usage Arguments Details Value Note Author(s) References See Also Examples
Update regularization parameter and the associated Lasso regression coefficients, Updates can either be mini-batch or single observations.
1 2 |
object |
Current RAP object |
Ynew |
New response. In the case of mini-batch updates a vector should be provided. |
Xnew |
New covariates. This should be a matrix. |
... |
Additional arguments |
See Monti et al 2016
A RAP objecti is returned where the regularization parameter and the estimated regression coefficients have been updated.
Warning that this implementation uses the shooting algorithm (co-ordinate gradient descent) to update regression coefficients. A more efficient implementation would employ stochastic gradient descent.
Ricardo Pio Monti
See Monti et al, "A framework for adaptive regularization in streaming Lasso models", 2016
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Recreate Figure 1 from
library(lars)
data(diabetes)
Data = cbind(diabetes$y, diabetes$x)
# initialize RAP object
R = RAP(X = matrix(diabetes$x[1,], nrow=1), y = diabetes$y[1], r = .995, eps = 0.0005, l0 = .1)
# iteratively update:
## Not run:
for (i in 2:nrow(Data)){
R = update.RAP(object=R, Ynew = diabetes$y[i], Xnew=matrix(diabetes$x[i,], nrow=1))
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.