Description Usage Arguments Author(s) Examples
View source: R/predict.spls.wrap.R
Makes predictions from an spls.wrap model
1 | predict.spls.wrap(model, newx)
|
model |
|
newx |
Wesley Brooks
1 2 3 4 5 6 7 8 9 10 11 12 13 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (model, newx)
{
n = nrow(newx)
p = length(model[["coef"]])
b = matrix(model[["coef"]], nrow = p, ncol = 1)
x = matrix(newx, nrow = n, ncol = p)
return(x %*% b)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.