logit_lasso {iilasso} | R Documentation |
Fit a logistic regression model using a design matrix
logit_lasso(X_tilde, y, lambda.min.ratio = 1e-04, nlambda = 100, lambda = NULL, delta = 0, alpha = NULL, R = NULL, funcR = function(G) { abs(G)^2 }, maxit = 10000, eps = 1e-04, warm = "lambda", init.beta = NULL, strong = FALSE, sparse = FALSE, impl = "cpp", abs = TRUE)
X_tilde |
standardized matrix of explanatory variables |
y |
vector of objective variable |
lambda.min.ratio |
ratio of max lambda and min lambda |
nlambda |
the number of lambda (ignored if lambda is specified) |
lambda |
lambda sequence |
delta |
ratio of regularization (exclusive penalty / l1 penalty) (default: 0) |
alpha |
mixing parameter of regularization of l1 and exclusive penalty terms (delta = (1 - alpha) / alpha) |
R |
matrix using exclusive penalty term |
funcR |
function of R (input: X, output: R) |
maxit |
max iteration (default: 1e+4) |
eps |
convergence threshold for optimization (default: 1e-4) |
warm |
warm start direction: "lambda" (default) or "delta" |
init.beta |
initial values of beta |
strong |
whether use strong screening (default) or not |
sparse |
whether use sparse matrix or not (default) |
impl |
implementation language of optimization: "cpp" (default) or "r" |
abs |
(experimental) whether use absolute value of beta (default) or not |
lasso model
beta_standard |
standardized coefficients |
lambda |
regularization parameters |
alpha |
alpha defined above |
delta |
delta defined above |
X <- matrix(c(1,2,3,5,4,7,6,8,9,10), nrow=5, ncol=2) b <- matrix(c(-1,1), nrow=2, ncol=1) e <- matrix(c(0,-0.1,0.1,-0.1,0.1), nrow=5, ncol=1) y <- as.numeric(X %*% b + e) y <- ifelse(y>mean(y), 1, 0) fit <- lasso(X, y, family="binomial") pr <- predict_lasso(fit, X) plot_lasso(fit)