I would like to make sure that I am using the prediction method here correctly; maybe I am misinterpreting the parameter "s" here!? My intent is to use the best lambda obtained from cross validation to make my final predictions on a holdout dataset.
# set alpha to 1 for lasso
cv.fit <- cv.glmnet(x = mat, y = class, family = "binomial", alpha = 1, nfolds = 10)
val.m <- as.matrix(val.df[, -match(c("Id", "class"), names(val.df))])
preds <- predict(cv.fit, val.m, type="response", s = cv.lasso.fit$lambda.min)
It would be nice if someone could give me reassurance.