Skip to content

Commit

Permalink
add missing glmnet method for proportional hazard models (#1086)
Browse files Browse the repository at this point in the history
* add missing glmnet method

* Update NEWS.md

Co-authored-by: Hannah Frick <[email protected]>

---------

Co-authored-by: ‘topepo’ <‘[email protected]’>
Co-authored-by: Hannah Frick <[email protected]>
  • Loading branch information
3 people authored Mar 22, 2024
1 parent baec9a4 commit 0e49f78
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ S3method(set_engine,model_spec)
S3method(set_mode,default)
S3method(set_mode,model_spec)
S3method(tidy,"_LiblineaR")
S3method(tidy,"_coxnet")
S3method(tidy,"_elnet")
S3method(tidy,"_fishnet")
S3method(tidy,"_lognet")
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# parsnip (development version)

* Added a missing `tidy()` method for survival analysis glmnet models (#1086).

# parsnip 1.2.0

## Bug Fixes
Expand Down
6 changes: 6 additions & 0 deletions R/tidy_glmnet.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ tidy._fishnet <- function(x, penalty = NULL, ...) {
tidy_glmnet(x, penalty)
}

#' @export
#' @rdname tidy._elnet
tidy._coxnet <- function(x, penalty = NULL, ...) {
tidy_glmnet(x, penalty)
}

## -----------------------------------------------------------------------------

get_glmn_coefs <- function(x, penalty = 0.01) {
Expand Down
3 changes: 3 additions & 0 deletions man/tidy._elnet.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0e49f78

Please sign in to comment.