Skip to content
Snippets Groups Projects
Verified Commit 0229933b authored by Gärber, Florian's avatar Gärber, Florian
Browse files

doc: Fix mixed use of Rd and Md doc blocks

parent be742133
No related branches found
No related tags found
No related merge requests found
......@@ -36,5 +36,4 @@ LinkingTo:
Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
......@@ -18,6 +18,7 @@
#' * `layer`: Tree layer depth information, starting at 0 (root node) and incremented for each layer.
#'
#' @export
#' @md
addLayer <- function(trees, num.threads = 1) {
if (!inherits(trees, "RangerTrees")) {
stop("`trees` must be a `getTreeranger` `RangerTrees` object.")
......@@ -42,6 +43,7 @@ addLayer <- function(trees, num.threads = 1) {
#' @seealso [addLayer()]
#'
#' @keywords internal
#' @md
add_layer_to_tree <- function(tree) {
layer <- rep(NA, nrow(tree))
layer[1] <- 0
......
......@@ -21,6 +21,7 @@
#' * `adj_i`: adjusted agreement of variable i
#'
#' @export
#' @md
addSurrogates <- function(RF, trees, s, Xdata, num.threads = parallel::detectCores()) {
if (!inherits(RF, "ranger")) {
stop("`RF` must be a ranger object.")
......@@ -69,6 +70,7 @@ addSurrogates <- function(RF, trees, s, Xdata, num.threads = parallel::detectCor
#' This is an internal function
#'
#' @keywords internal
#' @md
getSurrogate <- function(surr.par, k = 1, maxsurr) {
# weights and trees are extracted
tree <- surr.par$trees[[k]]
......@@ -92,6 +94,7 @@ getSurrogate <- function(surr.par, k = 1, maxsurr) {
#' @useDynLib RFSurrogates, .registration = TRUE
#'
#' @keywords internal
#' @md
SurrTree <- function(j, wt, Xdata, controls, column.names, tree, maxsurr, ncat) {
node <- tree[j, ]
# for non-terminal nodes get surrogates
......@@ -145,6 +148,7 @@ SurrTree <- function(j, wt, Xdata, controls, column.names, tree, maxsurr, ncat)
#' This is an internal function
#'
#' @keywords internal
#' @md
name.surr <- function(i, surrogate.names) {
surrogate.names <- c(surrogate.names, paste0("surrogate_", i))
return(surrogate.names)
......@@ -155,6 +159,7 @@ name.surr <- function(i, surrogate.names) {
#' This is an internal function
#'
#' @keywords internal
#' @md
name.adj <- function(i, adj.names) {
adj.names <- c(adj.names, paste0("adj_", i))
return(adj.names)
......
......@@ -19,6 +19,7 @@
#' * `layer`: If `add_layer` is `TRUE`, see [addLayer()]
#'
#' @export
#' @md
getTreeranger <- function(RF, num.trees = RF$num.trees, add_layer = FALSE, num.threads = 1) {
trees <- parallel::mclapply(1:num.trees, getsingletree,
mc.cores = num.threads,
......@@ -53,6 +54,7 @@ getTreeranger <- function(RF, num.trees = RF$num.trees, add_layer = FALSE, num.t
#' * `status`: `0` for terminal (`splitpoint` is `NA`) and `1` for non-terminal.
#'
#' @keywords internal
#' @md
getsingletree <- function(RF, k = 1, add_layer = FALSE) {
# here we use the treeInfo function of the ranger package to create extract the trees, in an earlier version this was done with a self implemented function
tree.ranger <- ranger::treeInfo(RF, tree = k)
......
......@@ -36,7 +36,7 @@ classification mode is used). For survival forests this is the time variable.}
\item{type}{mode of prediction ("regression", "classification" or "survival"). Default is regression.}
\item{s}{predefined number of surrogate splits (it may happen that the actual number of surrogate splits differs in individual nodes). Default is 1 \\% of no. of variables.}
\item{s}{predefined number of surrogate splits (it may happen that the actual number of surrogate splits differs in individual nodes). Default is 1 \% of no. of variables.}
\item{mtry}{number of variables to possibly split at in each node. Default is no. of variables^(3/4) ("^3/4") as recommended by (Ishwaran 2011). Also possible is "sqrt" and "0.5" to use the square root or half of the no. of variables.}
......@@ -48,7 +48,7 @@ classification mode is used). For survival forests this is the time variable.}
\item{save.ranger}{set TRUE if ranger object should be saved. Default is that ranger object is not saved (FALSE).}
\item{create.forest}{Default: TRUE if \code{forest} is NULL, FALSE otherwise. Whether to create or use an existing forest.}
\item{create.forest}{Default: TRUE if `forest` is NULL, FALSE otherwise. Whether to create or use an existing forest.}
\item{forest}{the random forest that should be analyzed}
......
......@@ -37,7 +37,7 @@ classification mode is used). For survival forests this is the time variable.}
\item{type}{mode of prediction ("regression", "classification" or "survival"). Default is regression.}
\item{s}{predefined number of surrogate splits (it may happen that the actual number of surrogate splits differs in individual nodes). Default is 1 \\% of no. of variables.}
\item{s}{predefined number of surrogate splits (it may happen that the actual number of surrogate splits differs in individual nodes). Default is 1 \% of no. of variables.}
\item{mtry}{number of variables to possibly split at in each node. Default is no. of variables^(3/4) ("^3/4") as recommended by (Ishwaran 2011). Also possible is "sqrt" and "0.5" to use the square root or half of the no. of variables.}
......@@ -49,7 +49,7 @@ classification mode is used). For survival forests this is the time variable.}
\item{save.ranger}{set TRUE if ranger object should be saved. Default is that ranger object is not saved (FALSE).}
\item{create.forest}{Default: TRUE if \code{forest} is NULL, FALSE otherwise. Whether to create or use an existing forest.}
\item{create.forest}{Default: TRUE if `forest` is NULL, FALSE otherwise. Whether to create or use an existing forest.}
\item{forest}{the random forest that should be analyzed}
......
......@@ -41,7 +41,7 @@ classification mode is used). For survival forests this is the time variable.}
\item{save.ranger}{Set TRUE if ranger object should be saved. Default is that ranger object is not saved (FALSE).}
\item{create.forest}{Default: TRUE if \code{forest} is NULL, FALSE otherwise. Whether to create or use an existing forest.}
\item{create.forest}{Default: TRUE if `forest` is NULL, FALSE otherwise. Whether to create or use an existing forest.}
\item{forest}{the random forest that should be analyzed.}
......
......@@ -40,7 +40,7 @@ classification mode is used). For survival forests this is the time variable.}
\item{type}{mode of prediction ("regression", "classification" or "survival"). Default is regression.}
\item{s}{predefined number of surrogate splits (it may happen that the actual number of surrogate splits differs in individual nodes). Default is 1 \\% of no. of variables.}
\item{s}{predefined number of surrogate splits (it may happen that the actual number of surrogate splits differs in individual nodes). Default is 1 \% of no. of variables.}
\item{mtry}{number of variables to possibly split at in each node. Default is no. of variables^(3/4) ("^3/4") as recommended by (Ishwaran 2011). Also possible is "sqrt" and "0.5" to use the square root or half of the no. of variables.}
......
......@@ -32,7 +32,7 @@ classification mode is used). For survival forests this is the time variable.}
\item{type}{mode of prediction ("regression", "classification" or "survival"). Default is regression.}
\item{s}{predefined number of surrogate splits (it may happen that the actual number of surrogate splits differs in individual nodes). Default is 1 \\% of no. of variables.}
\item{s}{predefined number of surrogate splits (it may happen that the actual number of surrogate splits differs in individual nodes). Default is 1 \% of no. of variables.}
\item{mtry}{number of variables to possibly split at in each node. Default is no. of variables^(3/4) ("^3/4") as recommended by (Ishwaran 2011). Also possible is "sqrt" and "0.5" to use the square root or half of the no. of variables.}
......@@ -44,7 +44,7 @@ classification mode is used). For survival forests this is the time variable.}
\item{save.ranger}{set TRUE if ranger object should be saved. Default is that ranger object is not saved (FALSE).}
\item{create.forest}{Default: TRUE if \code{forest} is NULL, FALSE otherwise. Whether to create or use an existing forest.}
\item{create.forest}{Default: TRUE if `forest` is NULL, FALSE otherwise. Whether to create or use an existing forest.}
\item{forest}{the random forest that should be analyzed}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment