predict.biglasso | R Documentation |
biglasso
objectExtract predictions (fitted reponse, coefficients, etc.) from a
fitted biglasso()
object.
## S3 method for class 'biglasso'
predict(
object,
X,
row.idx = 1:nrow(X),
type = c("link", "response", "class", "coefficients", "vars", "nvars"),
lambda,
which = 1:length(object$lambda),
...
)
## S3 method for class 'mbiglasso'
predict(
object,
X,
row.idx = 1:nrow(X),
type = c("link", "response", "coefficients", "vars", "nvars"),
lambda,
which = 1:length(object$lambda),
k = 1,
...
)
## S3 method for class 'biglasso'
coef(object, lambda, which = 1:length(object$lambda), drop = TRUE, ...)
## S3 method for class 'mbiglasso'
coef(object, lambda, which = 1:length(object$lambda), intercept = TRUE, ...)
object |
A fitted |
X |
Matrix of values at which predictions are to be made. It must be a
|
row.idx |
Similar to that in |
type |
Type of prediction:
|
lambda |
Values of the regularization parameter |
which |
Indices of the penalty parameter |
... |
Not used. |
k |
Index of the response to predict in multiple responses regression (
|
drop |
If coefficients for a single value of |
intercept |
Whether the intercept should be included in the returned
coefficients. For |
The object returned depends on type
.
Yaohui Zeng and Patrick Breheny
biglasso()
, cv.biglasso()
## Logistic regression
data(colon)
X <- colon$X
y <- colon$y
X.bm <- as.big.matrix(X, backingfile = "")
fit <- biglasso(X.bm, y, penalty = 'lasso', family = "binomial")
coef <- coef(fit, lambda=0.05, drop = TRUE)
coef[which(coef != 0)]
predict(fit, X.bm, type="link", lambda=0.05)[1:10]
predict(fit, X.bm, type="response", lambda=0.05)[1:10]
predict(fit, X.bm, type="class", lambda=0.1)[1:10]
predict(fit, type="vars", lambda=c(0.05, 0.1))
predict(fit, type="nvars", lambda=c(0.05, 0.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.