Description Usage Arguments Details Value See Also Examples
View source: R/predict.pcLasso.R
This function returns the predictions from a "pcLasso
" object
for a new data matrix.
1 2 |
object |
Fitted " |
xnew |
Matrix of new values for |
... |
Potentially other arguments to be passed to and from methods; currently not in use. |
Note that xnew
should have the same number of columns as the original
feature space, regardless of whether the groups are overlapping or not.
Predictions of E(y|xnew) which the model object
makes at
xnew
. These are probabilities for the binomial family.
1 2 3 4 5 6 7 8 9 10 11 12 | set.seed(1)
x <- matrix(rnorm(100 * 20), 100, 20)
# family = "gaussian"
y <- rnorm(100)
fit1 <- pcLasso(x, y, ratio = 0.8)
predict(fit1, xnew = x[1:5, ])
# family = "binomial"
y2 <- sample(0:1, 100, replace = TRUE)
fit2 <- pcLasso(x, y2, ratio = 0.8, family = "binomial")
predict(fit2, xnew = x[1:5, ])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.