Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Dec 6, 2023
1 parent 6c5eb8e commit 837ed02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vignettes/alternative_software.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ The [`fmeffects` package](https://cran.r-project.org/package=fmeffects) is descr
As the name says, this package is focused on "forward marginal effects" in the context of machine learning models estimated using the `mlr3` or `tidymodels` frameworks. Since version 0.16.0, `marginaleffects` also supports these machine learning frameworks, and it covers a superset of the `fmeffects` functionality. Consider a random forest model trained on the `bikes` data:

```{r, message = FALSE, warning = FALSE}
```{r, message = FALSE, warning = FALSE, eval = FALSE}
library("mlr3verse")
library("fmeffects")
data("bikes", package = "fmeffects")
Expand All @@ -785,13 +785,13 @@ forest <- lrn("regr.ranger")$train(task)

Now, we use the `avg_comparisons()` function to compute *forward* marginal effects:

```{r}
```{r, eval = FALSE}
avg_comparisons(forest, variables = list(temp = 1), newdata = bikes)
```

This is equivalent to the key quantity reported by the `fmeffects` package:

```{r}
```{r, eval = FALSE}
fmeffects::fme(
model = forest,
data = bikes,
Expand All @@ -804,7 +804,7 @@ Another interesting feature of `fmeffects` is the ability treat categorical pred

In the `bikes` example, we can answer the question: how does the expected number of bike rentals increases, on average, if all days were misty? With `marginaleffects`, we can use a function in the `variables` argument to specify a custom contrast:

```{r}
```{r, eval = FALSE}
FUN <- function(x) data.frame(lo = x, hi = "misty")
avg_comparisons(
Expand Down

0 comments on commit 837ed02

Please sign in to comment.