You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the simulation for the lasso method, for each replication, the lasso will generate a coefficient matrix according to a sequence of lambda of size = nlambda. Based on the coef.lasso function copied below, is it correct to say that the lambda sequences are different for each replication because lambda max is different after computing for each replication dataset?
Then if the sequences are different, it is OK for the validation tuning, because the validation tuning selects the optimal metric in each replication. But is it also okay for the oracle tuning? Since the oracle tuning selects the minimum err.test in the function choose.tuning.params, which relies on the storing of the metrics err.test in a matrix, which does not share the same column names, i.e., the lambda sequences.
coef.lasso.from.glmnet = function(object, s=NULL) {
class(object) = "glmnet"
if (length(object$lambda)==object$nlambda) {
return(glmnet::coef.glmnet(object,s=s))
}
else {
min.lam = min(object$lambda)
max.lam = max(object$lambda)
svec = exp(seq(log(max.lam),log(min.lam),length=object$nlambda))
return(glmnet::coef.glmnet(object,s=svec))
## RJT TODO: should we used exact=TRUE above? Requires additional
## arguments to match the initial call to glmnet(), kind of clunky
## TH: use glmnet.control(fdev=0) at beginning of session
## Still needed though for cases when df exceeds p (can happen with
## glmnet, and bad for relaxed lasso)
}
}
The text was updated successfully, but these errors were encountered:
vtshen
changed the title
Sequences of lambda in the lasso method are different
Sequences of lambda in the lasso method are different for each replication
Sep 1, 2018
vtshen
changed the title
Sequences of lambda in the lasso method are different for each replication
Question on the oracle tuning because of the fact that sequences of lambda in the lasso method are different for each replication
Sep 2, 2018
In the simulation for the lasso method, for each replication, the lasso will generate a coefficient matrix according to a sequence of lambda of size = nlambda. Based on the coef.lasso function copied below, is it correct to say that the lambda sequences are different for each replication because lambda max is different after computing for each replication dataset?
Then if the sequences are different, it is OK for the validation tuning, because the validation tuning selects the optimal metric in each replication. But is it also okay for the oracle tuning? Since the oracle tuning selects the minimum err.test in the function choose.tuning.params, which relies on the storing of the metrics err.test in a matrix, which does not share the same column names, i.e., the lambda sequences.
The text was updated successfully, but these errors were encountered: