diff --git a/DESCRIPTION b/DESCRIPTION index 9ba94a2a..571d78d4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,10 +1,12 @@ Package: ranger Type: Package Title: A Fast Implementation of Random Forests -Version: 0.16.4 -Date: 2024-10-28 -Author: Marvin N. Wright [aut, cre], Stefan Wager [ctb], Philipp Probst [ctb] -Maintainer: Marvin N. Wright +Version: 0.17.0 +Date: 2024-11-08 +Authors@R: c( + person("Marvin N.", "Wright", email = "cran@wrig.de", role = c("aut", "cre")), + person("Stefan", "Wager", role = "ctb"), + person("Philipp", "Probst", role = "ctb")) Description: A fast implementation of Random Forests, particularly suited for high dimensional data. Ensembles of classification, regression, survival and probability prediction trees are supported. Data from genome-wide association diff --git a/NAMESPACE b/NAMESPACE index 64d06c48..6dd59911 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -11,6 +11,8 @@ S3method(print,deforest.ranger) S3method(print,ranger) S3method(print,ranger.forest) S3method(print,ranger.prediction) +S3method(str,ranger) +S3method(str,ranger.forest) S3method(timepoints,ranger) S3method(timepoints,ranger.prediction) export(csrf) diff --git a/NEWS b/NEWS index ed9481ca..db4e8b6c 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,12 @@ +##### Version 0.17.0 +* Set num.threads=2 as default; respect environment variables and options +* Add handling of missing values for classification and regression +* Allow vector min.node.size and min.bucket for class-specific limits +* Add Poisson splitting rule for regression trees +* Add hierarchical shrinkage +* Fix a bug for always.split.variables (for some settings) + ##### Version 0.16.0 * Add node.stats option to save node statistics of all nodes * Add time.interest option to restrict unique survival times (faster and saves memory) diff --git a/NEWS.md b/NEWS.md index 32d0a57a..ffe77060 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,7 @@ +# ranger 0.17.0 +* New CRAN version + # ranger 0.16.4 * Add handling of missing values for classification and regression diff --git a/R/hshrink.R b/R/hshrink.R index 001866f4..45794e84 100644 --- a/R/hshrink.R +++ b/R/hshrink.R @@ -39,6 +39,9 @@ #' @return The ranger object is modified in-place. #' #' @examples +#' ## Hierarchical shrinkage for a probablity forest +#' rf <- ranger(Species ~ ., iris, node.stats = TRUE, probability = TRUE) +#' hshrink(rf, lambda = 5) ##' @references ##' \itemize{ ##' \item Agarwal, A., Tan, Y.S., Ronen, O., Singh, C. & Yu, B. (2022). Hierarchical Shrinkage: Improving the accuracy and interpretability of tree-based models. Proceedings of the 39th International Conference on Machine Learning, PMLR 162:111-135. diff --git a/R/print.R b/R/print.R index 90e78bc2..8f02bf09 100644 --- a/R/print.R +++ b/R/print.R @@ -103,11 +103,13 @@ print.ranger.prediction <- function(x, ...) { } } +##' @export str.ranger.forest <- function(object, max.level = 2, ...) { class(object) <- "list" str(object, max.level = max.level, ...) } +##' @export str.ranger <- function(object, max.level = 2, ...) { class(object) <- "list" str(object, max.level = max.level, ...) diff --git a/cpp_version/src/version.h b/cpp_version/src/version.h index 4aeaffdf..c417d41b 100644 --- a/cpp_version/src/version.h +++ b/cpp_version/src/version.h @@ -1,3 +1,3 @@ #ifndef RANGER_VERSION -#define RANGER_VERSION "0.16.3" +#define RANGER_VERSION "0.17.0" #endif diff --git a/man/hshrink.Rd b/man/hshrink.Rd index e48c9a2e..fd813e59 100644 --- a/man/hshrink.Rd +++ b/man/hshrink.Rd @@ -19,6 +19,11 @@ Apply hierarchical shrinkage to a ranger object. Hierarchical shrinkage is a regularization technique that recursively shrinks node predictions towards parent node predictions. For details see Agarwal et al. (2022). } +\examples{ +## Hierarchical shrinkage for a probablity forest +rf <- ranger(Species ~ ., iris, node.stats = TRUE, probability = TRUE) +hshrink(rf, lambda = 5) +} \references{ \itemize{ \item Agarwal, A., Tan, Y.S., Ronen, O., Singh, C. & Yu, B. (2022). Hierarchical Shrinkage: Improving the accuracy and interpretability of tree-based models. Proceedings of the 39th International Conference on Machine Learning, PMLR 162:111-135.