Skip to content

Commit

Permalink
Merge 5458cf6 into 3007aae
Browse files Browse the repository at this point in the history
  • Loading branch information
mayer79 authored Oct 21, 2023
2 parents 3007aae + 5458cf6 commit d4695a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
- `print.shapviz()` now shows top two rows of SHAP matrix.
- Re-activate all unit tests.
- Added "How to contribute" to README.
- `sv_dependence2D()`: In case `add_vars` are passed, `x` and/or `y` are removed from it in order to not use any variable twice.

## Bug fixes

- `sv_dependence2D()`: In case `add_vars` are passed, `x` and/or `y` are removed from it in order to not use any variable twice. [#116](https://github.com/ModelOriented/shapviz/pull/116).
- `split.shapviz()` now drops empty levels. They launched an error because empty "shapviz" objects are currently not supported. [#117](https://github.com/ModelOriented/shapviz/pull/117)

# shapviz 0.9.2

Expand Down
5 changes: 3 additions & 2 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ c.shapviz <- function(...) {
#'
#' @param x Object of class "shapviz".
#' @param f Vector used to split feature values and SHAP (interaction) values.
#' @param ... Arguments passed to `split()`.
#' @param ... Arguments passed to `split()`. Don't pass `drop = TRUE` as empty
#' "shapviz" objects are rejected.
#' @returns A "mshapviz" object.
#' @examples
#' \dontrun{
Expand All @@ -367,7 +368,7 @@ c.shapviz <- function(...) {
#' @export
#' @seealso [shapviz()], [rbind.shapviz()]
split.shapviz <- function(x, f, ...) {
ind <- split(seq_len(nrow(x)), f = f, ...)
ind <- split(seq_len(nrow(x)), f = f, drop = FALSE, ...)
mshapviz(lapply(ind, function(i) x[i, ]))
}

Expand Down
3 changes: 2 additions & 1 deletion man/split.shapviz.Rd

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

0 comments on commit d4695a7

Please sign in to comment.