Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
distr6 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael committed Jul 30, 2020
1 parent ebaf7d4 commit dc2c33c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: mlr3learners.coxboost
Title: Learners from the {CoxBoost} package for 'mlr3'
Version: 0.1.1.9000
Version: 0.1.2
Authors@R:
person(given = "Raphael",
family = "Sonabend",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# mlr3learners.coxboost 0.1.2

- distr6 patch

# mlr3learners.coxboost 0.1.1

- Removed remotes dependencies
Expand Down
2 changes: 1 addition & 1 deletion R/LearnerSurvCVCoxboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ LearnerSurvCVCoxboost = R6Class("LearnerSurvCVCoxboost",
times = sort(unique(self$model$time)))

# define WeightedDiscrete distr6 object from predicted survival function
x = rep(list(x = sort(unique(self$model$time)), cdf = 0), task$nrow)
x = rep(list(list(x = sort(unique(self$model$time)), cdf = 0)), task$nrow)
for (i in 1:task$nrow) {
x[[i]]$cdf = cdf[i, ]
}
Expand Down
2 changes: 1 addition & 1 deletion R/LearnerSurvCoxboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ LearnerSurvCoxboost = R6Class("LearnerSurvCoxboost",
times = sort(unique(self$model$time)))

# define WeightedDiscrete distr6 object from predicted survival function
x = rep(list(x = sort(unique(self$model$time)), cdf = 0), task$nrow)
x = rep(list(list(x = sort(unique(self$model$time)), cdf = 0)), task$nrow)
for (i in 1:task$nrow) {
x[[i]]$cdf = cdf[i, ]
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test_surv_coxboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ context("surv.coxboost")
test_that("autotest", {
learner = LearnerSurvCoxboost$new()
expect_learner(learner)
result = run_autotest(learner)
result = run_autotest(learner,check_replicable = FALSE)
expect_true(result, info = result$error)
})
2 changes: 1 addition & 1 deletion tests/testthat/test_surv_cvcoxboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ test_that("autotest", {
set.seed(1)
learner = lrn("surv.cvcoxboost", maxstepno = 1, K = 2)
expect_learner(learner)
result = run_autotest(learner, N = 10)
result = run_autotest(learner, N = 10,check_replicable = FALSE)
expect_true(result, info = result$error)
})

Expand Down

2 comments on commit dc2c33c

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/testthat/test_surv_coxboost.R:6:33: style: Commas should always have a space after.

result = run_autotest(learner,check_replicable = FALSE)
                                ^

tests/testthat/test_surv_cvcoxboost.R:7:41: style: Commas should always have a space after.

result = run_autotest(learner, N = 10,check_replicable = FALSE)
                                        ^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/testthat/test_surv_coxboost.R:6:33: style: Commas should always have a space after.

result = run_autotest(learner,check_replicable = FALSE)
                                ^

tests/testthat/test_surv_cvcoxboost.R:7:41: style: Commas should always have a space after.

result = run_autotest(learner, N = 10,check_replicable = FALSE)
                                        ^

Please sign in to comment.