diff --git a/DESCRIPTION b/DESCRIPTION index b8f4ed76b98175a9344586caf6a3f1be57aa57de..41b67146660aab9c52adabf2af8e59cfbd6f56db 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: RFSurrogates Title: Surrogate Minimal Depth Variable Importance -Version: 0.4.0 +Version: 0.4.1 Authors@R: c( person("Stephan", "Seifert", , "stephan.seifert@uni-hamburg.de", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2567-5728")), @@ -36,4 +36,4 @@ LinkingTo: Config/testthat/edition: 3 Encoding: UTF-8 LazyData: true -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 diff --git a/NEWS.md b/NEWS.md index be12c5476b84fe9823ebcb409f86472a7368bfae..d05eb8e89a214fe53e3008695ab5dc4d3aa7c6f6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# RFSurrogates 0.4.1 + +- Fix `SurrogateMinimalDepth`'s result `$selected` returning modified names (#13) + # RFSurrogates 0.4.0 **Added `RandomForestSurrogates()`.** diff --git a/R/surrmindep.R b/R/surrmindep.R index b96fa9b4a2ca711d8c3b1ae17e3e0f93d24fc068..9c46ced2a8964e1d9128f97d5dcae064345fe5be 100644 --- a/R/surrmindep.R +++ b/R/surrmindep.R @@ -86,6 +86,7 @@ surrmindep <- function(forest, s.l = count.surrogates(forest$trees)$s.l) { p.1 <- 1 - p.root threshold <- p.root * 0 + p.1 * 1 warning("Trees are very small! Threshold is defined based on trees with only root nodes.") + threshold <- unname(threshold) } if ((avgTreeHeight) >= 2) { diff --git a/man/surrmindep.Rd b/man/surrmindep.Rd index 82a603f3a3ab2b2277454dd67f9d88316e7034a0..9ab65471f35d3bbde957ffb481f6c67fbb55916c 100644 --- a/man/surrmindep.Rd +++ b/man/surrmindep.Rd @@ -7,23 +7,21 @@ surrmindep(forest, s.l = count.surrogates(forest$trees)$s.l) } \arguments{ -\item{forest}{a list containing \code{allvariables} and \code{trees}. +\item{forest}{a list containing `allvariables` and `trees`. Allvariables is a vector of all variable names in the original data set (strings). -Trees is a list of trees that was generated by \code{\link[=getTreeranger]{getTreeranger()}}, -\code{\link[=addLayer]{addLayer()}}, and \code{\link[=addSurrogates]{addSurrogates()}}.} +Trees is a list of trees that was generated by [getTreeranger()], +[addLayer()], and [addSurrogates()].} \item{s.l}{Number of average surrogate variables in the respective layers. -(use \code{\link[=count.surrogates]{count.surrogates()}} function to get it)} +(use [count.surrogates()] function to get it)} } \value{ List with the following components: -\itemize{ -\item \code{depth}: mean surrogate minimal depth for each variable -\item \code{selected}: variables has been selected (1) or not (0), -\item \code{threshold}: the threshold that is used for the selection -} + * `depth`: mean surrogate minimal depth for each variable + * `selected`: variables has been selected (1) or not (0), + * `threshold`: the threshold that is used for the selection } \description{ This function determines the surrogate minimal depth of variables from a -forest that is created by \code{\link[=getTreeranger]{getTreeranger()}}, \code{\link[=addLayer]{addLayer()}} and \code{\link[=addSurrogates]{addSurrogates()}} functions. +forest that is created by [getTreeranger()], [addLayer()] and [addSurrogates()] functions. }