Description Usage Arguments Examples
Predicted values based on (sparse or sparse group) PLS models. Regression coefficient and new predictions are given using the new observations.
1 2 3 |
object |
An object of class bigsgPLS |
newX |
matrix or big.matrix object to make prediction on. |
ng |
The number of chuncks used to read in the data and process using parallel computing. |
comps |
A vector with the number of components to use in the PLS fit. |
da |
Discriminant analysis argument to provide class estimates. |
... |
Further arguments passed for methods. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | set.seed(1)
library(bigmemory)
n <- 15000
p <- 50
X = scale(matrix(rnorm(n*p), ncol = p, nrow = n))
y = X[,1:5] %*% 1:5 + rnorm(n)
X.bm <- as.big.matrix(X)
y.bm <- as.big.matrix(y)
library(doParallel)
registerDoParallel(cores = 2)
getDoParWorkers()
fit.PLS <- bigsgpls(X.bm, y.bm, case = 4, H = 4, ng = 10, keepX = rep(5,4), regularised = "sparse")
pred.fit <- predict(fit.PLS, newX = X, ng = 1)
round(pred.fit$Beta,3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.