Repository navigation
9/9 Cox elastic net: lambda path ends at 0.05 of the largest value by default (changes results; 6.6x faster) - #134
Merged
Conversation
This was referenced Oct 10, 2026
ellispatrick
force-pushed
the
review/9-coxnet-path
branch
from
October 10, 2026 22:47
9bff739 to
c712639
Compare
…by default (changes results) Why: lambdas near zero give nearly unpenalised Cox models, which overfit the few events of typical omics cohorts (39 relapses in the protocol's METABRIC data) and converge slowly. On the protocol's Procedure 2 step 7 (merge of five views, 31 combinations, 20 x 5 CV, 16 cores), compared with glmnet's default path: - mean C-index over the 31 combinations 0.602 vs 0.599; best in 21 of 31 combinations; - 1.4 min vs 9.2 min; - cross-validation had chosen a lambda below 0.05 of the largest in 12% of fold models; clipping those did not lower the C-index. Tuning by partial likelihood deviance was also compared and gave lower C-indexes (0.587), so tuning by C-index stays. ncvreg uses the same 0.05 when there are more features than samples. Users can still set lambda or lambda.min.ratio through extraParams. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4
ellispatrick
force-pushed
the
review/9-coxnet-path
branch
from
October 14, 2026 00:20
c712639 to
333aa6c
Compare
DarioS
marked this pull request as ready for review
October 28, 2026 02:27
DarioS
approved these changes
Oct 28, 2026
DarioS
left a comment
Member
There was a problem hiding this comment.
Speed improvement but the same accuracy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes results (decided by Ellis Patrick's delegation, on the evidence below). The Cox elastic net (
classifier = "CoxNet") ends its path of lambda at 0.05 of the largest value by default. glmnet's own default is 0.0001 with more samples than features, 0.01 otherwise. Tuning by C-index is kept.Why
Evidence
Protocol Procedure 2 step 7: merge of clinical, Domain Proportions, Proportions of Parent, Colocalisation and RNA Microarray views; all 31 combinations; 20 × 5 CV; shared folds; 16 cores.
What changes
coxnetTrainInterfacepasseslambda.min.ratio = 0.05unless the user giveslambdaorlambda.min.ratio(e.g.extraParams = list(train = list(lambda.min.ratio = 1e-4))restores glmnet's default).Evidence
544 test expectations pass. Scripts and per-combination results: ProjectClassifyR
scripts/coxnet_tuning/.🤖 Generated with Claude Code
https://claude.ai/code/session_01TfsjwkbDbHkX4kJZNe4ER4