Skip to content

Commit 97c0e43

Browse files
authored
export methods for censoring model (#966)
1 parent ab42409 commit 97c0e43

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: parsnip
22
Title: A Common API to Modeling and Analysis Functions
3-
Version: 1.1.0.9001
3+
Version: 1.1.0.9002
44
Authors@R: c(
55
person("Max", "Kuhn", , "[email protected]", role = c("aut", "cre")),
66
person("Davis", "Vaughan", , "[email protected]", role = "aut"),

NAMESPACE

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ S3method(predict,"_elnet")
3535
S3method(predict,"_glmnetfit")
3636
S3method(predict,"_lognet")
3737
S3method(predict,"_multnet")
38+
S3method(predict,censoring_model)
3839
S3method(predict,censoring_model_reverse_km)
3940
S3method(predict,model_fit)
4041
S3method(predict,model_spec)
@@ -61,6 +62,7 @@ S3method(predict_raw,"_multnet")
6162
S3method(predict_raw,model_fit)
6263
S3method(predict_survival,model_fit)
6364
S3method(predict_time,model_fit)
65+
S3method(print,censoring_model)
6466
S3method(print,control_parsnip)
6567
S3method(print,model_fit)
6668
S3method(print,model_spec)

R/survival-censoring-model.R

+2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ reverse_km <- function(obj, eval_env) {
4646
# ------------------------------------------------------------------------------
4747
# Basic S3 methods
4848

49+
#' @export
4950
print.censoring_model <- function(x, ...) {
5051
cat(x$label, "model for predicting the probability of censoring\n")
5152
invisible(x)
5253
}
5354

55+
#' @export
5456
predict.censoring_model <- function(object, ...) {
5557
rlang::abort(
5658
paste("Don't know how to predict with a censoring model of type:", object$label)

0 commit comments

Comments
 (0)