Closed crsl4 closed 4 years ago
It is best to fit Lasso Co-ordinate descent via a series of λ, going down from λmax to the required λ.
It is not better to given one value of λ, especially a very small one relative to λmax.
This is because, given the sudden jump from λmax to λ=0.000893361, the model needs to consider way too many predictors. But going in small increments you need to consider much fewer.
I am sure you do not need f3
you can just use f2
to get the fit for your desired λ=0.000893361.
I see, thanks for the explanation. I thought it would be saving computation time if I fit lasso for a given lambda, as opposed to a series of lambdas. I was using a subset of my data in cross validation to determine the "best" lambda, and then wanted to use this lambda for the full dataset (instead of multiple lambdas that might take longer). But I could just run in a series of lambdas for the full data, and just pick the fit corresponding to the "best" lambda. Thanks!
I am not able to set one given value of lambda for the Lasso fit. I am not sure if the lambda parameter is one lambda per covariate, or just a vector of lambdas to try (if we want only one lambda, we would still need to put in an array, because an array is expected). Either way, I get an error.
The error is strange because for that exact value of lambda, the initial fit would include 427 covariates in the model (less than the limit of 1038).
I attach a test data file. test.txt