-
Notifications
You must be signed in to change notification settings - Fork 216
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
Alpha Behavior #41
Comments
Can you clarify a bit the phrase "5 alphas deep"? Not exactly sure what this means. Thanks! |
By 5 alphas deep, I mean that the coefficient path output (model.coef_) is of shape (Mx5) where M is the number of parameters in the regression and 5 is the alpha depth. I would have expected an output with a shape of (M x n_alphas).
but in each instance, the model.coef_ output is (Mx5). Thank you for replying and I apologize if there is some caveat I am missing. |
I think you are mixing different concepts:
|
Yes, I understand how the alpha grid works and I agree with everything you said above, I think I may not be explaining very well and it may be one of those one off issues with the data I am working with. |
One possible issue I could imagine when using If you want to double check, you can try R's |
This was a good idea. I checked the same data using |
You are correct, glmnet's Are you saying that scikit-survival does not return the full path of 10 alphas, but glmnet does? Could you plot the individual estimates as dots in the plots, in addition to lines, please. |
Yes, in this particular instance, it is not returning the full path of alphas no matter what |
One quick thought: in |
Sorry for the delay in response. I tried your suggestion but it did not work. It seems like a unique issue and in the end, with the way |
I have a feeling this might be similar to the issue or confusion I’ve been having related to alphas that I commented on in #47. I’ve found that Coxnet will silently not use all the alphas down the autogenerated sequence once the alpha values gets too small, but it won’t raise any warnings or errors during the fit. For example, it might calculate an alpha max of 1.5 from the data and with an I only realized this when I was trying to do model selection/CV based on the gist example and got @dex314 I would consider increasing Also @sebp it might be a good idea to have two default values for |
That's a good idea, would you be able to provide a pull request with this change? |
The default value of alpha_min_ratio will depend on the sample size relative to the number of features in 0.13. If `n_samples > n_features`, the current default value 0.0001 will be used. If `n_samples < n_features`, 0.01 will be used instead. See #41 (comment)
The default value for |
Hello scikit-survival team. Thanks for the awesome package. Is there a solution for this yet? Essentially I would like Sometimes I will specify 100 alphas, it would only use the first 6. Funny enough always only 6. I can provide you with example code if need be. |
When I run a model like this example:
mod = coxnet.CoxnetSurvivalAnalysis(n_alphas=30, l1_ratio=1.0)
There are times (and it could be data specific) where the length of the coefficients out of the model are less than the n_alphas I specified. For example, it often stops at 5 alphas deep.
The paths might have 15 variables > 0 (coming out) at 5 alphas deep, which is fine. The strange thing I am seeing is, lets say I set n_alphas=20 on the same data set. I end up getting more variables > 0 along the path (and still stopping at 5 alphas deep) or vice verse, if I set n_alphas = 40 on the same data set, I end up getting less variables > 0 along the path and once again the algorithm is automatically stopping at 5 alphas deep. (Im referring to the parameters as variables.)
Im assuming this is a bug as the way I have working with Elastic Nets in the past is that the alpha sequence should exponentially decrease toward some min but I should see more variables > 0 as I move forward and closer to the min in this alpha curve. Such that if I see 15 variables at alpha=30, then I should see <15 at alpha<30 and the reverse.
Could there be some ratio somewhere that is picking up a variable of similar name to a global that is confusing the alpha parameters in the Elastic net?
The text was updated successfully, but these errors were encountered: