-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get coef(cvfit, s = "lambda.min") #31
Comments
I think the example in the README.md exactly that: julia> cv = glmnetcv(X, y)
Least Squares GLMNet Cross Validation
55 models for 4 predictors in 10 folds
Best λ 0.343 (mean loss 76.946, std 12.546)
julia> argmin(cv.meanloss)
48
julia> cv.path.betas[:, 48]
4-element Array{Float64,1}:
0.926911
0.00366805
0.0
0.0 If not, perhaps look at other fields of the returned |
Thanks for response, but the question is which field should be? to get the coef automatically with lambda.min as R package does. R code shown in https://web.stanford.edu/~hastie/glmnet/glmnet_alpha.html
|
I would guess its |
cv.meanloss should be a series of mean loss for a certain λ as shown below. what I need a coef matrix to select variables for a small s. cv = glmnetcv(X, y) julia> cv.meanloss |
That is what the other two lines I quoted earlier do. |
Thanks |
how to simply get coef(cvfit, s = "lambda.min") as R does
The text was updated successfully, but these errors were encountered: