Skip to content

Commit

Permalink
fix: store learner in state of PipeOpBreslow
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Jan 18, 2024
1 parent 8565481 commit 6987cc7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/PipeOpBreslow.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ PipeOpBreslow = R6Class("PipeOpBreslow",

# keep the training data that Breslow estimator needs
self$state = list(
learner = learner,
times = task$times(),
status = task$status(),
lp_train = p$lp
Expand All @@ -134,7 +135,7 @@ PipeOpBreslow = R6Class("PipeOpBreslow",

.predict = function(inputs) {
task = inputs[[1]]
learner = private$.learner
learner = self$state$learner

if (is.null(learner$model)) {
stopf("Cannot predict, Learner '%s' has not been trained yet", learner$id)
Expand Down

0 comments on commit 6987cc7

Please sign in to comment.