Description Usage Arguments Value Examples
Training by using gradient descent on a linear model with square loss . Return a matrix of weight vector for each iteration to the max iteration.
1 | LMSquareLossIterations(X.mat, y.vec, max.iterations, step.size = 0.5)
|
X.mat |
train feature matrix of size [n x p] |
y.vec |
train label vector of size [n x 1] |
max.iterations |
integer scalar greater than 1 |
step.size |
integer scalar |
W.mat matrix of weight vectors of size [(p + 1) x max.iterations]. A prediction can be obtained by cbind(1,X.mat)
1 2 3 4 | data(ozone, package = "ElemStatLearn")
y.vec <- ozone[, 1]
X.mat <- as.matrix(ozone[,-1])
W.mat <- LMSquareLossIterations(X.mat, y.vec, max.iterations = 5L)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.