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
Hi,
on line 129 of fitfuns.R, it looks like glmnet.lasso_maxCoef() is not sorting the coefficients in the right order. The code is: selected <- order(coef(fit)[-1])[1:q]
Here is a reproducible example that would capture lines 126 and 129:
Hi,
on line 129 of fitfuns.R, it looks like glmnet.lasso_maxCoef() is not sorting the coefficients in the right order. The code is:
selected <- order(coef(fit)[-1])[1:q]
Here is a reproducible example that would capture lines 126 and 129:
I would have expected the sorting to be done on the absolute value of the coefficients. Assuming this is the intent, two possible solutions are:
or
I believe the later solution is used in
glmnet.lasso()
on lines 31 and 32 of fitfuns.RThanks
Peter
The text was updated successfully, but these errors were encountered: