diff --git a/DESCRIPTION b/DESCRIPTION index 59b4f60..5011466 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -12,7 +12,7 @@ License: GPL-3 Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.1.1 +RoxygenNote: 7.1.2 Imports: DALEX, dendextend, diff --git a/NAMESPACE b/NAMESPACE index 1017134..0696c4e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -33,6 +33,7 @@ importFrom(grDevices,hcl) importFrom(graphics,plot) importFrom(ingredients,accumulated_dependence) importFrom(ingredients,partial_dependence) +importFrom(sets,set) importFrom(sets,set_union) importFrom(stats,AIC) importFrom(stats,aggregate) diff --git a/NEWS.md b/NEWS.md index 9ba8046..e9fe5ff 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # version 0.1.3 - Updated DESCRIPTION (arxiv link changed to doi). - Added citation to [Simpler is better: Lifting interpretability-performance trade-off via automated feature engineering](https://doi.org/10.1016/j.dss.2021.113556). +- Small fixes for compatibility with `sets` package. # version 0.1.2 diff --git a/R/safely_detect_changepoints.R b/R/safely_detect_changepoints.R index f7c0ca5..d50d20b 100644 --- a/R/safely_detect_changepoints.R +++ b/R/safely_detect_changepoints.R @@ -25,7 +25,6 @@ #' data <- c(rnorm(15, 0), rnorm(20, 2), rnorm(30, 8)) #' safely_detect_changepoints(data) #' safely_detect_changepoints(data, penalty = 25) -#' #' @export safely_detect_changepoints <- function(data, penalty = "MBIC", nquantiles = 10) { @@ -120,7 +119,7 @@ cost <- function(data, u, v, sumstat, K) { #function that evaluates cost of data } -#' @importFrom sets set_union +#' @importFrom sets set_union set PELT_algorithm <- function(data, penalty_value, sumstat, K) { if (is.null(data)) { @@ -166,13 +165,13 @@ PELT_algorithm <- function(data, penalty_value, sumstat, K) { #updating R set for next iterations - removing those points that can never be the last optimal changepoint for (tau in R) { if (Q[tau+1] + cost(data, tau+1, v, sumstat, K) > Q[v+1] + epsilon) { - R <- R - tau + R <- R - set(tau) } } R <- set_union(R, v) } - cpts_final <- cp[[n+1]] - 0 + cpts_final <- cp[[n+1]] - set(0) return(sort(unlist(cpts_final))) diff --git a/inst/CITATION b/inst/CITATION index 5e5536a..d83cf86 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -5,7 +5,7 @@ bibentry(bibtype = "Article", pages = "113556", year = "2021", issn = "0167-9236", - doi = "https://doi.org/10.1016/j.dss.2021.113556", + doi = "10.1016/j.dss.2021.113556", url = "https://www.sciencedirect.com/science/article/pii/S016792362100066X", author = "Alicja Gosiewska and Anna Kozak and Przemyslaw Biecek", ) diff --git a/inst/WORDLIST b/inst/WORDLIST index 6696e76..30717cc 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -4,6 +4,8 @@ Bemowo Bielany CMD DALEX +doi +dss GBM Hannan Kaggle @@ -32,6 +34,7 @@ github glm https interpretable +interpretability kaggle mcquitty param diff --git a/man/rSAFE-package.Rd b/man/rSAFE-package.Rd index a98863e..d6f02dc 100644 --- a/man/rSAFE-package.Rd +++ b/man/rSAFE-package.Rd @@ -8,7 +8,7 @@ \description{ \if{html}{\figure{logo.png}{options: align='right' alt='logo' width='120'}} -Provides a model agnostic tool for white-box model trained on features extracted from a black-box model. For more information see: Gosiewska et al. (2020) . +Provides a model agnostic tool for white-box model trained on features extracted from a black-box model. For more information see: Gosiewska et al. (2020) . } \seealso{ Useful links: diff --git a/man/safely_detect_changepoints.Rd b/man/safely_detect_changepoints.Rd index 508931d..c9b22c1 100644 --- a/man/safely_detect_changepoints.Rd +++ b/man/safely_detect_changepoints.Rd @@ -34,7 +34,6 @@ set.seed(123) data <- c(rnorm(15, 0), rnorm(20, 2), rnorm(30, 8)) safely_detect_changepoints(data) safely_detect_changepoints(data, penalty = 25) - } \seealso{ \code{\link{safely_transform_continuous}} diff --git a/tests/testthat/_snaps/extraction/plot-continuous-variable.svg b/tests/testthat/_snaps/extraction/plot-continuous-variable.svg new file mode 100644 index 0000000..dbc3d3a --- /dev/null +++ b/tests/testthat/_snaps/extraction/plot-continuous-variable.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +construction.year + + +1920 +1940 +1960 +1980 +2000 +-600 +-400 +-200 +0 +average prediction + +randomForest +Created for the randomForest model +Accumulated Dependence profile + + diff --git a/tests/testthat/_snaps/extraction/plot-discrete-variable.svg b/tests/testthat/_snaps/extraction/plot-discrete-variable.svg new file mode 100644 index 0000000..a5585d0 --- /dev/null +++ b/tests/testthat/_snaps/extraction/plot-discrete-variable.svg @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Mokotow +Bemowo +Wola +Bielany +Ursynow +Praga +Ursus +Srodmiescie +Ochota +Zoliborz + + +district + +