predict.cv.biglasso | R Documentation |
cv.biglasso()
objectExtract predictions from a fitted cv.biglasso()
object.
## S3 method for class 'cv.biglasso'
predict(
object,
X,
row.idx = 1:nrow(X),
type = c("link", "response", "class", "coefficients", "vars", "nvars"),
lambda = object$lambda.min,
which = object$min,
...
)
## S3 method for class 'cv.biglasso'
coef(object, lambda = object$lambda.min, which = object$min, ...)
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. |
The object returned depends on type
.
Yaohui Zeng and Patrick Breheny
biglasso()
, cv.biglasso()
## Not run:
## predict.cv.biglasso
data(colon)
X <- colon$X
y <- colon$y
X.bm <- as.big.matrix(X, backingfile = "")
fit <- biglasso(X.bm, y, penalty = 'lasso', family = "binomial")
cvfit <- cv.biglasso(X.bm, y, penalty = 'lasso', family = "binomial", seed = 1234, ncores = 2)
coef <- coef(cvfit)
coef[which(coef != 0)]
predict(cvfit, X.bm, type = "response")
predict(cvfit, X.bm, type = "link")
predict(cvfit, X.bm, type = "class")
predict(cvfit, X.bm, lambda = "lambda.1se")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.