diff --git a/.Rbuildignore b/.Rbuildignore
index f8d8128c..03781c23 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -16,3 +16,4 @@
^Rmd/
lastMiKTeXException
^\.zenodo\.json$
+^scratch\.R$
diff --git a/R/orsf.R b/R/orsf.R
index d3cd273f..5dc015fe 100644
--- a/R/orsf.R
+++ b/R/orsf.R
@@ -85,16 +85,23 @@
#' of randomly selected predictors, up to `n_retry` times. Default is
#' `n_retry = 3`. Set `n_retry = 0` to prevent any retries.
#'
-#' @param n_thread `r roxy_n_thread_header()`
+#' @param n_thread `r roxy_n_thread_header("growing trees, computing predictions, and computing importance.")`
#'
#' @param mtry (_integer_) Number of predictors randomly included as candidates
#' for splitting a node. The default is the smallest integer greater than
#' the square root of the number of total predictors, i.e.,
#' `mtry = ceiling(sqrt(number of predictors))`
#'
-#' @param sample_with_replacement
+#' @param sample_with_replacement (_logical_) If `TRUE` (the default),
+#' observations are sampled with replacement when an in-bag sample
+#' is created for a decision tree. If `FALSE`, observations are
+#' sampled without replacement and each tree will have an in-bag sample
+#' containing `sample_fraction`% of the original sample.
#'
-#' @param sample_fraction
+#' @param sample_fraction (_double_) the proportion of observations that
+#' each trees' in-bag sample will contain, relative to the number of
+#' rows in `data`. Only used if `sample_with_replacement` is `FALSE`.
+#' Default value is 0.632.
#'
#' @param leaf_min_events (_integer_) minimum number of events in a
#' leaf node. Default is `leaf_min_events = 1`
@@ -186,7 +193,7 @@
#' to the output will be the imputed version of `data`.
#'
#' @param verbose_progress (_logical_) if `TRUE`, progress messages are
-#' printed in the console.
+#' printed in the console. If `FALSE` (the default), nothing is printed.
#'
#' @param ... `r roxy_dots()`
#'
diff --git a/R/orsf_pd.R b/R/orsf_pd.R
index a330e94e..011c77d3 100644
--- a/R/orsf_pd.R
+++ b/R/orsf_pd.R
@@ -60,6 +60,8 @@
#' percentile in the object's training data. If `FALSE`, these checks are
#' skipped.
#'
+#' @param n_thread `r roxy_n_thread_header("computing predictions")`
+#'
#' @param ... `r roxy_dots()`
#'
#' @return a [data.table][data.table::data.table-package] containing
@@ -309,6 +311,9 @@ orsf_pred_dependence <- function(object,
pred_horizon <- infer_pred_horizon(object, pred_horizon)
+ # make a visible binding for CRAN
+ id_variable = NULL
+
if(is.null(prob_values)) prob_values <- c(0.025, 0.50, 0.975)
if(is.null(prob_labels)) prob_labels <- c('lwr', 'medn', 'upr')
diff --git a/R/orsf_predict.R b/R/orsf_predict.R
index d74e1ff3..6cbae26f 100644
--- a/R/orsf_predict.R
+++ b/R/orsf_predict.R
@@ -45,6 +45,18 @@
#' observed time in `object`'s training data. If `FALSE`, these checks
#' are skipped.
#'
+#' @param n_thread `r roxy_n_thread_header("computing predictions")`
+#'
+#' @param pred_aggregate (_logical_) If `TRUE` (the default), predictions
+#' will be aggregated over all trees by taking the mean. If `FALSE`, the
+#' returned output will contain one row per observation and one column
+#' for each tree. If the length of `pred_horizon` is two or more and
+#' `pred_aggregate` is `FALSE`, then the result will be a list of such
+#' matrices, with the i'th item in the list corresponding to the i'th
+#' value of `pred_horizon`.
+#'
+#' @inheritParams orsf
+#'
#' @param ... `r roxy_dots()`
#'
#' @return a `matrix` of predictions. Column `j` of the matrix corresponds
@@ -119,15 +131,15 @@ predict.orsf_fit <- function(object,
results <- lapply(
X = pred_horizon,
FUN = function(t){
- predict(object = object,
- new_data = new_data,
- pred_horizon = t,
- pred_type = pred_type,
- na_action = na_action,
- boundary_checks = boundary_checks,
- n_thread = n_thread,
- verbose_progress = verbose_progress,
- pred_aggregate = pred_aggregate)
+ predict.orsf_fit(object = object,
+ new_data = new_data,
+ pred_horizon = t,
+ pred_type = pred_type,
+ na_action = na_action,
+ boundary_checks = boundary_checks,
+ n_thread = n_thread,
+ verbose_progress = verbose_progress,
+ pred_aggregate = pred_aggregate)
}
)
diff --git a/R/roxy.R b/R/roxy.R
index 202c0840..e9e312a1 100644
--- a/R/roxy.R
+++ b/R/roxy.R
@@ -16,8 +16,9 @@ roxy_data_allowed <- function(){
# multi-threading ---------------------------------------------------------
-roxy_n_thread_header <- function(){
- "(_integer_) number of threads to use. Default is one thread."
+roxy_n_thread_header <- function(action){
+ paste("(_integer_) number of threads to use while ",
+ action, ". Default is one thread.", sep = "")
}
roxy_n_thread_details <- function(){
diff --git a/man/orsf.Rd b/man/orsf.Rd
index 2141cdc7..4e01f015 100644
--- a/man/orsf.Rd
+++ b/man/orsf.Rd
@@ -83,16 +83,23 @@ will try again with a new linear combination based on a different set
of randomly selected predictors, up to \code{n_retry} times. Default is
\code{n_retry = 3}. Set \code{n_retry = 0} to prevent any retries.}
-\item{n_thread}{(\emph{integer}) number of threads to use. Default is one thread.}
+\item{n_thread}{(\emph{integer}) number of threads to use while growing trees, computing predictions, and computing importance.. Default is one thread.}
\item{mtry}{(\emph{integer}) Number of predictors randomly included as candidates
for splitting a node. The default is the smallest integer greater than
the square root of the number of total predictors, i.e.,
\verb{mtry = ceiling(sqrt(number of predictors))}}
-\item{sample_with_replacement}{}
+\item{sample_with_replacement}{(\emph{logical}) If \code{TRUE} (the default),
+observations are sampled with replacement when an in-bag sample
+is created for a decision tree. If \code{FALSE}, observations are
+sampled without replacement and each tree will have an in-bag sample
+containing \code{sample_fraction}\% of the original sample.}
-\item{sample_fraction}{}
+\item{sample_fraction}{(\emph{double}) the proportion of observations that
+each trees' in-bag sample will contain, relative to the number of
+rows in \code{data}. Only used if \code{sample_with_replacement} is \code{FALSE}.
+Default value is 0.632.}
\item{leaf_min_events}{(\emph{integer}) minimum number of events in a
leaf node. Default is \code{leaf_min_events = 1}}
@@ -191,7 +198,7 @@ to the output will be the imputed version of \code{data}.
}}
\item{verbose_progress}{(\emph{logical}) if \code{TRUE}, progress messages are
-printed in the console.}
+printed in the console. If \code{FALSE} (the default), nothing is printed.}
\item{...}{Further arguments passed to or from other methods (not currently used).}
diff --git a/man/orsf_control_custom.Rd b/man/orsf_control_custom.Rd
index b90ceff9..f4888c7a 100644
--- a/man/orsf_control_custom.Rd
+++ b/man/orsf_control_custom.Rd
@@ -135,15 +135,15 @@ The PCA ORSF does quite well! (higher IPA is better)
##
## model times Brier lower upper IPA
## 1: Null model 1788 20.479 18.090 22.868 0.000
-## 2: rando 1788 11.600 9.529 13.671 43.355
-## 3: pca 1788 12.717 10.759 14.675 37.903
+## 2: rando 1788 11.784 9.689 13.878 42.460
+## 3: pca 1788 12.685 10.694 14.675 38.061
##
## Results of model comparisons:
##
## times model reference delta.Brier lower upper p
-## 1: 1788 rando Null model -8.879 -11.046 -6.712 9.753163e-16
-## 2: 1788 pca Null model -7.762 -9.517 -6.008 4.257842e-18
-## 3: 1788 pca rando 1.116 0.300 1.933 7.334072e-03
+## 1: 1788 rando Null model -8.695 -10.811 -6.580 7.854170e-16
+## 2: 1788 pca Null model -7.794 -9.475 -6.114 9.797721e-20
+## 3: 1788 pca rando 0.901 0.174 1.629 1.519521e-02
##
## NOTE: Values are multiplied by 100 and given in \%.
diff --git a/man/orsf_ice_oob.Rd b/man/orsf_ice_oob.Rd
index 67799736..5791b237 100644
--- a/man/orsf_ice_oob.Rd
+++ b/man/orsf_ice_oob.Rd
@@ -83,6 +83,8 @@ to make sure the requested values are between the 10th and 90th
percentile in the object's training data. If \code{FALSE}, these checks are
skipped.}
+\item{n_thread}{(\emph{integer}) number of threads to use while computing predictions. Default is one thread.}
+
\item{...}{Further arguments passed to or from other methods (not currently used).}
\item{new_data}{a \link{data.frame}, \link[tibble:tibble-package]{tibble}, or \link[data.table:data.table]{data.table} to compute predictions in.}
@@ -150,17 +152,17 @@ ice_oob
}\if{html}{\out{}}
\if{html}{\out{
}}\preformatted{## id_variable id_row pred_horizon bili pred
-## 1: 1 1 1788 1 0.9295584
-## 2: 1 2 1788 1 0.1412476
-## 3: 1 3 1788 1 0.7047846
-## 4: 1 4 1788 1 0.3673939
-## 5: 1 5 1788 1 0.1206201
+## 1: 1 1 1788 1 0.9011797
+## 2: 1 2 1788 1 0.1096207
+## 3: 1 3 1788 1 0.7646444
+## 4: 1 4 1788 1 0.3531060
+## 5: 1 5 1788 1 0.1228441
## ---
-## 6896: 25 272 1788 10 0.3909254
-## 6897: 25 273 1788 10 0.4854526
-## 6898: 25 274 1788 10 0.4417335
-## 6899: 25 275 1788 10 0.3639220
-## 6900: 25 276 1788 10 0.5409864
+## 6896: 25 272 1788 10 0.3089586
+## 6897: 25 273 1788 10 0.4005430
+## 6898: 25 274 1788 10 0.4933945
+## 6899: 25 275 1788 10 0.3134373
+## 6900: 25 276 1788 10 0.5002014
}\if{html}{\out{
}}
Much more detailed examples are given in the
diff --git a/man/orsf_pd_oob.Rd b/man/orsf_pd_oob.Rd
index 80a53e05..80dc0dc0 100644
--- a/man/orsf_pd_oob.Rd
+++ b/man/orsf_pd_oob.Rd
@@ -101,6 +101,8 @@ to make sure the requested values are between the 10th and 90th
percentile in the object's training data. If \code{FALSE}, these checks are
skipped.}
+\item{n_thread}{(\emph{integer}) number of threads to use while computing predictions. Default is one thread.}
+
\item{...}{Further arguments passed to or from other methods (not currently used).}
\item{new_data}{a \link{data.frame}, \link[tibble:tibble-package]{tibble}, or \link[data.table:data.table]{data.table} to compute predictions in.}
@@ -158,12 +160,12 @@ You can compute partial dependence and ICE three ways with \code{aorsf}:
pd_train
}\if{html}{\out{}}
-\if{html}{\out{}}\preformatted{## pred_horizon bili mean lwr medn upr
-## 1: 1826.25 1 0.2167954 0.01432475 0.0946650 0.8243506
-## 2: 1826.25 2 0.2520765 0.03084190 0.1333465 0.8442959
-## 3: 1826.25 3 0.2964487 0.05324065 0.1937964 0.8578131
-## 4: 1826.25 4 0.3518250 0.09798050 0.2751326 0.8699063
-## 5: 1826.25 5 0.3936739 0.14573200 0.2984227 0.8781099
+\if{html}{\out{
}}\preformatted{## pred_horizon bili mean lwr medn upr
+## 1: 1826.25 1 0.2151663 0.02028479 0.09634648 0.7997269
+## 2: 1826.25 2 0.2576618 0.03766695 0.15497447 0.8211875
+## 3: 1826.25 3 0.2998484 0.06436773 0.20771324 0.8425637
+## 4: 1826.25 4 0.3390664 0.08427149 0.25401067 0.8589590
+## 5: 1826.25 5 0.3699045 0.10650098 0.28284427 0.8689855
}\if{html}{\out{
}}
\item using out-of-bag predictions for the training data
@@ -172,12 +174,12 @@ pd_train
pd_train
}\if{html}{\out{
}}
-\if{html}{\out{}}\preformatted{## pred_horizon bili mean lwr medn upr
-## 1: 1826.25 1 0.2161745 0.01183390 0.1001640 0.8304537
-## 2: 1826.25 2 0.2521996 0.02447359 0.1419482 0.8484741
-## 3: 1826.25 3 0.2961802 0.04854875 0.1992512 0.8640601
-## 4: 1826.25 4 0.3532215 0.10111235 0.2666702 0.8642393
-## 5: 1826.25 5 0.3940203 0.14768055 0.3270825 0.8737186
+\if{html}{\out{
}}\preformatted{## pred_horizon bili mean lwr medn upr
+## 1: 1826.25 1 0.2145044 0.01835000 0.09619052 0.7980629
+## 2: 1826.25 2 0.2566241 0.03535358 0.14185734 0.8173143
+## 3: 1826.25 3 0.2984693 0.05900059 0.20515477 0.8334243
+## 4: 1826.25 4 0.3383547 0.07887323 0.24347513 0.8469769
+## 5: 1826.25 5 0.3696260 0.10450534 0.28065473 0.8523756
}\if{html}{\out{
}}
\item using predictions for a new set of data
@@ -189,11 +191,11 @@ pd_test
}\if{html}{\out{
}}
\if{html}{\out{}}\preformatted{## pred_horizon bili mean lwr medn upr
-## 1: 1826.25 1 0.2643571 0.01758300 0.2098936 0.8410357
-## 2: 1826.25 2 0.2990417 0.04063388 0.2516202 0.8547441
-## 3: 1826.25 3 0.3432271 0.06843859 0.3056799 0.8664949
-## 4: 1826.25 4 0.3967879 0.11801725 0.3593064 0.8721247
-## 5: 1826.25 5 0.4388518 0.16038177 0.4094224 0.8800138
+## 1: 1826.25 1 0.2542230 0.02901386 0.1943767 0.8143912
+## 2: 1826.25 2 0.2955726 0.05037316 0.2474559 0.8317684
+## 3: 1826.25 3 0.3388434 0.07453896 0.3010898 0.8488622
+## 4: 1826.25 4 0.3800254 0.10565022 0.3516805 0.8592057
+## 5: 1826.25 5 0.4124587 0.12292465 0.3915066 0.8690074
}\if{html}{\out{
}}
\item in-bag partial dependence indicates relationships that the model has
learned during training. This is helpful if your goal is to interpret
diff --git a/man/orsf_vi.Rd b/man/orsf_vi.Rd
index 9dfc2810..bdfc8013 100644
--- a/man/orsf_vi.Rd
+++ b/man/orsf_vi.Rd
@@ -71,6 +71,11 @@ importance is estimated.
For more details, see the out-of-bag
\href{https://docs.ropensci.org/aorsf/articles/oobag.html}{vignette}.}
+\item{n_thread}{(\emph{integer}) number of threads to use while computing predictions. Default is one thread.}
+
+\item{verbose_progress}{(\emph{logical}) if \code{TRUE}, progress messages are
+printed in the console. If \code{FALSE} (the default), nothing is printed.}
+
\item{...}{Further arguments passed to or from other methods (not currently used).}
}
\value{
@@ -151,12 +156,12 @@ the ‘raw’ variable importance values can be accessed from the fit object
\if{html}{\out{}}\preformatted{attr(fit, 'importance_values')
}\if{html}{\out{
}}
-\if{html}{\out{}}\preformatted{## ascites_1 edema_1 bili copper albumin age
-## 0.44989185 0.43904209 0.29908016 0.22471022 0.20573664 0.19373368
-## edema_0.5 protime chol stage spiders_1 ast
-## 0.19096711 0.17582704 0.17527675 0.17057992 0.16721527 0.16061635
-## sex_f hepato_1 trig alk.phos platelet trt_placebo
-## 0.14513788 0.14241390 0.12698834 0.12228332 0.10395510 0.09001406
+\if{html}{\out{
}}\preformatted{## ascites_1 edema_1 bili albumin copper edema_0.5
+## 0.44146501 0.43190921 0.29391304 0.22145499 0.22120519 0.20110957
+## age protime chol spiders_1 stage sex_f
+## 0.19980193 0.19329637 0.17777778 0.17772293 0.16048729 0.15926709
+## hepato_1 ast trig alk.phos platelet trt_placebo
+## 0.15816481 0.15734785 0.13200993 0.12433796 0.11844461 0.09404636
}\if{html}{\out{
}}
these are ‘raw’ because values for factors have not been aggregated into
@@ -175,24 +180,24 @@ To get aggregated values across all levels of each factor,
\if{html}{\out{
}}\preformatted{fit$importance
}\if{html}{\out{
}}
-\if{html}{\out{
}}\preformatted{## ascites bili edema copper albumin age protime
-## 0.44989185 0.29908016 0.29137841 0.22471022 0.20573664 0.19373368 0.17582704
-## chol stage spiders ast sex hepato trig
-## 0.17527675 0.17057992 0.16721527 0.16061635 0.14513788 0.14241390 0.12698834
+\if{html}{\out{
}}\preformatted{## ascites edema bili albumin copper age protime
+## 0.44146501 0.29452847 0.29391304 0.22145499 0.22120519 0.19980193 0.19329637
+## chol spiders stage sex hepato ast trig
+## 0.17777778 0.17772293 0.16048729 0.15926709 0.15816481 0.15734785 0.13200993
## alk.phos platelet trt
-## 0.12228332 0.10395510 0.09001406
+## 0.12433796 0.11844461 0.09404636
}\if{html}{\out{
}}
\item use \code{orsf_vi()} with group_factors set to \code{TRUE} (the default)
\if{html}{\out{
}}\preformatted{orsf_vi(fit)
}\if{html}{\out{
}}
-\if{html}{\out{
}}\preformatted{## ascites bili edema copper albumin age protime
-## 0.44989185 0.29908016 0.29137841 0.22471022 0.20573664 0.19373368 0.17582704
-## chol stage spiders ast sex hepato trig
-## 0.17527675 0.17057992 0.16721527 0.16061635 0.14513788 0.14241390 0.12698834
+\if{html}{\out{
}}\preformatted{## ascites edema bili albumin copper age protime
+## 0.44146501 0.29452847 0.29391304 0.22145499 0.22120519 0.19980193 0.19329637
+## chol spiders stage sex hepato ast trig
+## 0.17777778 0.17772293 0.16048729 0.15926709 0.15816481 0.15734785 0.13200993
## alk.phos platelet trt
-## 0.12228332 0.10395510 0.09001406
+## 0.12433796 0.11844461 0.09404636
}\if{html}{\out{
}}
}
@@ -215,25 +220,27 @@ You can fit an ORSF without VI, then add VI later
orsf_vi_negate(fit_no_vi)
}\if{html}{\out{
}}
-\if{html}{\out{
}}\preformatted{## bili copper sex stage protime age
-## 0.117730704 0.046729117 0.038092882 0.026541912 0.024044523 0.022579987
-## albumin ascites chol ast hepato edema
-## 0.020445566 0.015747970 0.013665771 0.011546707 0.007505877 0.007380968
-## trt spiders alk.phos trig platelet
-## 0.006090162 0.005384646 0.003535311 0.003363440 0.001137152
+\if{html}{\out{
}}\preformatted{## bili copper sex protime stage
+## 0.1139657923 0.0498712200 0.0355366377 0.0283554322 0.0263792287
+## albumin age ascites chol ast
+## 0.0231636378 0.0195791833 0.0175120075 0.0148252414 0.0104918262
+## edema spiders hepato trt trig
+## 0.0084871358 0.0070608860 0.0067054788 0.0052040792 0.0030363455
+## alk.phos platelet
+## 0.0029918139 -0.0003309069
}\if{html}{\out{
}}
\if{html}{\out{
}}\preformatted{orsf_vi_permute(fit_no_vi)
}\if{html}{\out{
}}
-\if{html}{\out{
}}\preformatted{## bili copper protime age albumin
-## 0.0548467795 0.0223917526 0.0145052464 0.0143080180 0.0129163843
-## ascites stage chol hepato ast
-## 0.0126002596 0.0123809698 0.0067530051 0.0063142977 0.0061418741
-## edema sex spiders trig alk.phos
-## 0.0056802985 0.0036623429 0.0036022538 0.0018681065 0.0016083830
+\if{html}{\out{
}}\preformatted{## bili copper albumin protime ascites
+## 0.0538801986 0.0235904126 0.0144632299 0.0142037786 0.0123519716
+## stage age edema hepato chol
+## 0.0120377993 0.0110782938 0.0055307145 0.0052409958 0.0047839166
+## ast spiders sex trig alk.phos
+## 0.0042115620 0.0039660651 0.0028902730 0.0021803920 0.0018880548
## platelet trt
-## 0.0008698127 -0.0018486429
+## 0.0005279898 -0.0024330707
}\if{html}{\out{
}}
}
@@ -249,12 +256,14 @@ fit an ORSF and compute vi at the same time
orsf_vi_permute(fit_permute_vi)
}\if{html}{\out{
}}
-\if{html}{\out{
}}\preformatted{## bili copper protime age ascites stage
-## 0.054096726 0.021642597 0.012982646 0.012791086 0.011814535 0.011340900
-## albumin ast edema chol hepato spiders
-## 0.011210041 0.007311084 0.005830548 0.005810293 0.004883486 0.004378305
-## sex platelet trig alk.phos trt
-## 0.002637627 0.001703578 0.001330196 0.001088634 -0.000672300
+\if{html}{\out{
}}\preformatted{## bili copper age albumin ascites
+## 0.0513074950 0.0217622790 0.0131467379 0.0121683721 0.0120025410
+## stage protime chol edema ast
+## 0.0112281635 0.0108887695 0.0064301068 0.0061316531 0.0055392320
+## spiders hepato sex alk.phos trig
+## 0.0046819086 0.0026387295 0.0026066599 0.0017043328 0.0012899918
+## platelet trt
+## 0.0007224274 -0.0005790547
}\if{html}{\out{
}}
You can still get negation VI from this fit, but it needs to be computed
@@ -262,12 +271,12 @@ You can still get negation VI from this fit, but it needs to be computed
\if{html}{\out{
}}\preformatted{orsf_vi_negate(fit_permute_vi)
}\if{html}{\out{
}}
-\if{html}{\out{
}}\preformatted{## bili copper sex age protime stage
-## 0.121157363 0.046443795 0.036413372 0.022874454 0.021931876 0.020768489
-## albumin ascites ast chol edema spiders
-## 0.018865052 0.014014246 0.013016756 0.011260147 0.007998584 0.006157751
-## trt hepato trig alk.phos platelet
-## 0.005142056 0.005064243 0.003148662 0.003033804 0.002143418
+\if{html}{\out{
}}\preformatted{## bili copper sex stage age protime
+## 0.1106715167 0.0456031656 0.0306666098 0.0304383573 0.0252136203 0.0224838590
+## albumin ascites chol ast edema trt
+## 0.0212630703 0.0168893963 0.0134174671 0.0132075752 0.0099681058 0.0088378768
+## spiders hepato trig alk.phos platelet
+## 0.0078776082 0.0062877323 0.0043076141 0.0030432581 0.0005571111
}\if{html}{\out{
}}
}
}
diff --git a/man/predict.orsf_fit.Rd b/man/predict.orsf_fit.Rd
index be8c5509..b748aa03 100644
--- a/man/predict.orsf_fit.Rd
+++ b/man/predict.orsf_fit.Rd
@@ -54,6 +54,19 @@ checked to make sure the requested values are less than the maximum
observed time in \code{object}'s training data. If \code{FALSE}, these checks
are skipped.}
+\item{n_thread}{(\emph{integer}) number of threads to use while computing predictions. Default is one thread.}
+
+\item{verbose_progress}{(\emph{logical}) if \code{TRUE}, progress messages are
+printed in the console. If \code{FALSE} (the default), nothing is printed.}
+
+\item{pred_aggregate}{(\emph{logical}) If \code{TRUE} (the default), predictions
+will be aggregated over all trees by taking the mean. If \code{FALSE}, the
+returned output will contain one row per observation and one column
+for each tree. If the length of \code{pred_horizon} is two or more and
+\code{pred_aggregate} is \code{FALSE}, then the result will be a list of such
+matrices, with the i'th item in the list corresponding to the i'th
+value of \code{pred_horizon}.}
+
\item{...}{Further arguments passed to or from other methods (not currently used).}
}
\value{
@@ -107,11 +120,11 @@ predict(fit,
}\if{html}{\out{
}}
\if{html}{\out{
}}\preformatted{## [,1] [,2] [,3]
-## [1,] 0.49828550 0.77570208 0.91812971
-## [2,] 0.04475471 0.09161544 0.17682278
-## [3,] 0.12850458 0.27603519 0.41455070
-## [4,] 0.01279086 0.02980402 0.06458151
-## [5,] 0.01277317 0.02249769 0.04875677
+## [1,] 0.49679905 0.77309053 0.90830168
+## [2,] 0.03363621 0.08527972 0.17061414
+## [3,] 0.15129784 0.30402666 0.43747212
+## [4,] 0.01152480 0.02950914 0.07068198
+## [5,] 0.01035341 0.01942262 0.05117679
}\if{html}{\out{
}}
\if{html}{\out{
}}\preformatted{# predicted survival, i.e., 1 - risk
@@ -122,11 +135,11 @@ predict(fit,
}\if{html}{\out{
}}
\if{html}{\out{
}}\preformatted{## [,1] [,2] [,3]
-## [1,] 0.5017145 0.2242979 0.08187029
-## [2,] 0.9552453 0.9083846 0.82317722
-## [3,] 0.8714954 0.7239648 0.58544930
-## [4,] 0.9872091 0.9701960 0.93541849
-## [5,] 0.9872268 0.9775023 0.95124323
+## [1,] 0.5032009 0.2269095 0.09169832
+## [2,] 0.9663638 0.9147203 0.82938586
+## [3,] 0.8487022 0.6959733 0.56252788
+## [4,] 0.9884752 0.9704909 0.92931802
+## [5,] 0.9896466 0.9805774 0.94882321
}\if{html}{\out{
}}
\if{html}{\out{
}}\preformatted{# predicted cumulative hazard function
@@ -138,11 +151,11 @@ predict(fit,
}\if{html}{\out{
}}
\if{html}{\out{
}}\preformatted{## [,1] [,2] [,3]
-## [1,] 0.70791303 1.40367742 1.79658865
-## [2,] 0.04954335 0.11460828 0.24130253
-## [3,] 0.16616222 0.43287394 0.71524591
-## [4,] 0.01443848 0.03640393 0.08366798
-## [5,] 0.01435412 0.02680792 0.06203327
+## [1,] 0.74442414 1.39538511 1.78344589
+## [2,] 0.03473938 0.10418984 0.24047328
+## [3,] 0.19732086 0.47015754 0.73629459
+## [4,] 0.01169147 0.03223257 0.09564168
+## [5,] 0.01072007 0.02240040 0.06464319
}\if{html}{\out{
}}
Predict mortality, defined as the number of events in the forest’s
@@ -156,11 +169,11 @@ prediction horizon
}\if{html}{\out{
}}
\if{html}{\out{
}}\preformatted{## [,1]
-## [1,] 82.87688
-## [2,] 28.34298
-## [3,] 42.42506
-## [4,] 16.15515
-## [5,] 10.86385
+## [1,] 83.08611
+## [2,] 27.48146
+## [3,] 43.52432
+## [4,] 15.20281
+## [5,] 10.56334
}\if{html}{\out{
}}
}
diff --git a/src/Tree.cpp b/src/Tree.cpp
index 13027e8f..4113fb28 100644
--- a/src/Tree.cpp
+++ b/src/Tree.cpp
@@ -518,7 +518,6 @@
}
- // cuts_sampled = sort(cuts_sampled);
// initialize grouping for the current node
// value of 1 indicates go to right node
g_node.ones(lincomb.size());
diff --git a/tests/testthat/test-orsf_vi.R b/tests/testthat/test-orsf_vi.R
index f1fc4148..2b41a25e 100644
--- a/tests/testthat/test-orsf_vi.R
+++ b/tests/testthat/test-orsf_vi.R
@@ -78,9 +78,9 @@ oobag_fun_4_args <- function(y_mat, w_vec, s_vec, nope){
}
-oobag_fun_errors_on_test <- function(y_mat, s_vec){
+oobag_fun_errors_on_test <- function(y_mat, w_vec, s_vec){
- stop("I can't do anything!", call. = FALSE)
+ stop("expected error occurred!", call. = FALSE)
}
@@ -269,13 +269,10 @@ test_that(
regexp = 'type character'
)
- if(Sys.getenv("run_all_aorsf_tests") == 'yes'){
- expect_error(
- orsf_vi_negate(fit_no_vi, oobag_fun = oobag_fun_errors_on_test),
- regexp = 'encountered an error'
- )
- }
-
+ expect_error(
+ orsf_vi_negate(fit_no_vi, oobag_fun = oobag_fun_errors_on_test),
+ regexp = 'encountered an error'
+ )
expect_error(
orsf_vi_negate(fit_no_vi, oobag_fun = oobag_fun_4_args),