Skip to content

Commit

Permalink
add news, plot docu, update vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
holgstr committed Jun 4, 2024
1 parent 7f3b010 commit e5807ef
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
6 changes: 5 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# fmeffects 0.1.3

- `fme` and `ame` automatically extract the name of the model's target variable from the model.
- Added support for `"lm"`-type models, such as `stats::glm` and `mgcv::gam`.
- Added support for `"lm"`-type models, such as `stats::glm` and `mgcv::gam`.
- `fme` now computes NLMs via parallel processing with `future` and displays a progress bar while doing so.
- Multivariate effects for more than two features can be computed and visualized.
- Improved visualizations (especially for larger data sets) via hexagon plots.
- Better error communication with `cli`.
- Feature interactions for categorical features are supported.

# fmeffects 0.1.0

Expand Down
4 changes: 2 additions & 2 deletions R/FME.R
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ ForwardMarginalEffect = R6::R6Class("ForwardMarginalEffect",
#' @description
#' Plots results, i.e., FME (and NLMs) for non-extrapolation points, for an `FME` object.
#' @param with.nlm Plots NLMs if computed, defaults to `FALSE`.
#' @param bins Numeric vector giving number of bins in both vertical and horizontal directions.
#' @param bins Numeric vector giving number of bins in both vertical and horizontal directions. Applies only to univariate or bivariate numeric effects.
#' See [ggplot2::stat_summary_hex()] for details.
#' @param binwidth Numeric vector giving bin width in both vertical and horizontal directions. Overrides bins if both set.
#' @param binwidth Numeric vector giving bin width in both vertical and horizontal directions. Overrides bins if both set. Applies only to univariate or bivariate numeric effects.
#' See [ggplot2::stat_summary_hex()] for details.
#' @examples
#' # Compute results:
Expand Down
5 changes: 3 additions & 2 deletions R/FMEPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ FMEPlot = R6::R6Class("FMEPlot",

initializeSubclass = function(results, data, feature, step.size) {

# Check if results is a data.table with a minimum of one observation
checkmate::assertDataTable(results, min.rows = 1)
if (!checkmate::test_true(unique(results$fme) == 1)) {
cli::cli_abort(paste("Cannot plot effects if they all have the same value."))
}

self$feature = feature
self$step.size = step.size
Expand Down
4 changes: 2 additions & 2 deletions man/ForwardMarginalEffect.Rd

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

2 changes: 1 addition & 1 deletion vignettes/fmeffects.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ effects2 = fme(model = forest,
ep.method = "envelope")
```

For bivariate effects, we can plot the effects (we cannot for more than two features):
For bivariate effects, we can plot the effects in a way similar to univariate effects (for more than two features, we can plot only the histogram of effects):

```{r, message=FALSE}
plot(effects2)
Expand Down

0 comments on commit e5807ef

Please sign in to comment.