Skip to content

Commit

Permalink
add examples for AUC measures
Browse files Browse the repository at this point in the history
  • Loading branch information
bblodfon committed Dec 18, 2024
1 parent 20aa360 commit 14cf2b2
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/MeasureSurvChamblessAUC.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#'
#' @family AUC survival measures
#' @family lp survival measures
#' @template example_auc_measures
#' @export
MeasureSurvChamblessAUC = R6Class("MeasureSurvChamblessAUC",
inherit = MeasureSurvAUC,
Expand Down
1 change: 1 addition & 0 deletions R/MeasureSurvHungAUC.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#'
#' @family AUC survival measures
#' @family lp survival measures
#' @template example_auc_measures
#' @export
MeasureSurvHungAUC = R6Class("MeasureSurvHungAUC",
inherit = MeasureSurvAUC,
Expand Down
1 change: 1 addition & 0 deletions R/MeasureSurvSongAUC.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#'
#' @family AUC survival measures
#' @family lp survival measures
#' @template example_auc_measures
#' @export
MeasureSurvSongAUC = R6Class("MeasureSurvSongAUC",
inherit = MeasureSurvAUC,
Expand Down
1 change: 1 addition & 0 deletions R/MeasureSurvUnoAUC.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#'
#' @family AUC survival measures
#' @family lp survival measures
#' @template example_auc_measures
#' @export
MeasureSurvUnoAUC = R6Class("MeasureSurvUnoAUC",
inherit = MeasureSurvAUC,
Expand Down
27 changes: 27 additions & 0 deletions man-roxygen/example_auc_measures.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#' <% measure = suppressWarnings(get(fullname)$new()) %>
#'
#' @examples
#' library(mlr3)
#'
#' # Define a survival Task
#' task = tsk("lung")
#'
#' # Create train and test set
#' part = partition(task)
#'
#' # Train Cox learner on the train set
#' cox = lrn("surv.coxph")
#' cox$train(task, row_ids = part$train)
#'
#' # Make predictions for the test set
#' p = cox$predict(task, row_ids = part$test)
#'
#' # Integrated AUC score
#' p$score(msr("<%=measure$id%>"), task = task, train_set = part$train, learner = cox)
#'
#' # AUC at specific time point
#' p$score(msr("<%=measure$id%>", times = 600), task = task, train_set = part$train, learner = cox)
#'
#' # Integrated AUC at specific time points
#' p$score(msr("<%=measure$id%>", times = c(100, 200, 300, 400, 500)), task = task, train_set = part$train, learner = cox)
#'
26 changes: 26 additions & 0 deletions man/mlr_measures_surv.chambless_auc.Rd

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

26 changes: 26 additions & 0 deletions man/mlr_measures_surv.hung_auc.Rd

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

26 changes: 26 additions & 0 deletions man/mlr_measures_surv.song_auc.Rd

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

26 changes: 26 additions & 0 deletions man/mlr_measures_surv.uno_auc.Rd

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

0 comments on commit 14cf2b2

Please sign in to comment.