
cv.biglasso
object.
"predict"(object, X, row.idx = 1:nrow(X), type = c("link", "response", "class", "coefficients", "vars", "nvars"), lambda = object$lambda.min, which = object$min, ...)
"coef"(object, lambda = object$lambda.min, which = object$min, ...)
"cv.biglasso"
model object.big.matrix
object. Not used for type="coefficients"
.biglasso
, it's a
vector of the row indices of X
that used for the prediction. 1:nrow(X)
by default."link"
returns the linear predictors;
"response"
gives the fitted values; "class"
returns the binomial
outcome with the highest probability; "coefficients"
returns the coefficients;
"vars"
returns a list containing the indices and names of the nonzero variables at each value of lambda
; "nvars"
returns the number of nonzero coefficients at each value of lambda
.lambda
at which
predictions are requested. The default value is the one corresponding to the
minimum cross-validation error.lambda
at which predictions
are requested. The default value is the index of lambda corresponding to lambda.min.
Note: this is overridden if lambda
is specified.type
.biglasso
, cv.biglasso
## predict.cv.biglasso
data(colon)
X <- colon$X
y <- colon$y
X.bm <- as.big.matrix(X)
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")
Run the code above in your browser using DataLab