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.
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
multi_predict()
for coxnet models #70multi_predict()
for coxnet models #70Changes from 11 commits
bbda5b6
e0a26fe
88b6b52
4eae66b
4f2c05e
443434b
be838d1
ee69dd5
43be33f
63db438
a73f7a9
99ed2bc
996e185
3d80dc7
cf982f0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this else statement is pretty long, you might consider making two helpers for the specific predict types and doing:
That would also make it easier to extend if we get more types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved the code for
linear_pred
into its helper function 👍 Regarding the switch statement: I think the other types may require a similar structure as the survival probabilities so hopefully the rest is justpredict(type = type)
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are currently predict methods for types
"linear_pred"
and"survival"
. For the"linear_pred"
-type predictions, this follows what parsnip does for linear_reg() with a glmnet engine. For the survival probabilities, we use the survival curves fromsurvfit()
and have the wrappersurvival_prob_coxnet()
already so I extended that one to be able to deal with a vector of penalties. This also allows for convenient minimal nesting where we only group according to strata, see also #47 and #63.This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.