Skip to content

Commit

Permalink
Merge pull request #85 from mayer79/verbose_imp
Browse files Browse the repository at this point in the history
Set verbose = TRUE in perm_importance()
  • Loading branch information
mayer79 authored Oct 21, 2023
2 parents 7a97c03 + 688a185 commit 6e04fe0
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 63 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Missing grid values: `partial_dep()` and `ice()` have received a `na.rm` argument that controls if missing values are dropped during grid creation. The default `TRUE` is compatible with earlier releases.
- Missing values in `hstats()`: Discrete variables with missings would cause `rowsum()` to launch repeated warnings. This case is now catched.
- The position of some function arguments have changed.
- `perm_importance()`: The default of `verbose` is `TRUE` again.

# hstats 0.3.0

Expand Down
10 changes: 5 additions & 5 deletions R/perm_importance.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#'
#' # Groups of features can be passed as named list
#' v <- list(petal = c("Petal.Length", "Petal.Width"), species = "Species")
#' s <- perm_importance(fit, X = iris, y = "Sepal.Length", v = v)
#' s <- perm_importance(fit, X = iris, y = "Sepal.Length", v = v, verbose = FALSE)
#' s
#' plot(s)
#'
Expand All @@ -60,7 +60,7 @@ perm_importance.default <- function(object, X, y, v = NULL,
loss = "squared_error",
m_rep = 4L, agg_cols = FALSE,
normalize = FALSE, n_max = 10000L,
w = NULL, verbose = FALSE, ...) {
w = NULL, verbose = TRUE, ...) {
stopifnot(
is.matrix(X) || is.data.frame(X),
is.function(pred_fun),
Expand Down Expand Up @@ -203,7 +203,7 @@ perm_importance.ranger <- function(object, X, y, v = NULL,
loss = "squared_error", m_rep = 4L,
agg_cols = FALSE,
normalize = FALSE, n_max = 10000L,
w = NULL, verbose = FALSE, ...) {
w = NULL, verbose = TRUE, ...) {
perm_importance.default(
object = object,
X = X,
Expand All @@ -228,7 +228,7 @@ perm_importance.Learner <- function(object, X, y, v = NULL,
loss = "squared_error", m_rep = 4L,
agg_cols = FALSE,
normalize = FALSE, n_max = 10000L,
w = NULL, verbose = FALSE, ...) {
w = NULL, verbose = TRUE, ...) {
if (is.null(pred_fun)) {
pred_fun <- mlr3_pred_fun(object, X = X)
}
Expand Down Expand Up @@ -262,7 +262,7 @@ perm_importance.explainer <- function(object,
normalize = FALSE,
n_max = 10000L,
w = object[["weights"]],
verbose = FALSE,
verbose = TRUE,
...) {
perm_importance.default(
object = object[["model"]],
Expand Down
10 changes: 5 additions & 5 deletions man/perm_importance.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6e04fe0

Please sign in to comment.