Model predictions based on a fitted cv.biglasso object
Extract 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
Maintainer: Yaohui Zeng <yaohui.zeng@gmail.com>
## 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") ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.