Table of Contents
Fetching ...

fmeffects: An R Package for Forward Marginal Effects

Holger Löwe, Christian A. Scholbeck, Christian Heumann, Bernd Bischl, Giuseppe Casalicchio

TL;DR

The R package fmeffects is presented, the first software implementation of the theory surrounding forward marginal effects, and the relevant theoretical background, package functionality and handling, as well as the software design and options for future extensions are discussed.

Abstract

Forward marginal effects have recently been introduced as a versatile and effective model-agnostic interpretation method particularly suited for non-linear and non-parametric prediction models. They provide comprehensible model explanations of the form: if we change feature values by a pre-specified step size, what is the change in the predicted outcome? We present the R package fmeffects, the first software implementation of the theory surrounding forward marginal effects. The relevant theoretical background, package functionality and handling, as well as the software design and options for future extensions are discussed in this paper.

fmeffects: An R Package for Forward Marginal Effects

TL;DR

The R package fmeffects is presented, the first software implementation of the theory surrounding forward marginal effects, and the relevant theoretical background, package functionality and handling, as well as the software design and options for future extensions are discussed.

Abstract

Forward marginal effects have recently been introduced as a versatile and effective model-agnostic interpretation method particularly suited for non-linear and non-parametric prediction models. They provide comprehensible model explanations of the form: if we change feature values by a pre-specified step size, what is the change in the predicted outcome? We present the R package fmeffects, the first software implementation of the theory surrounding forward marginal effects. The relevant theoretical background, package functionality and handling, as well as the software design and options for future extensions are discussed in this paper.
Paper Structure (18 sections, 10 equations, 2 figures)

This paper contains 18 sections, 10 equations, 2 figures.

Figures (2)

  • Figure 1: Illustration by scholbeck_fme of a univariate FME (blue) given the prediction function (black) and linear secant (orange, dashed). The NLM indicates how well the secant can explain the prediction function (inversely proportional to the purple area) compared to how well the most uninformative baseline model (the average prediction) can explain the prediction function.
  • Figure 2: Illustration of the multivariate NLM by scholbeck_fme. Left: An exemplary bivariate prediction function and two points to compute an FME. Consider an observation $\bm{x} = (-5, -5)$ and step size vector $\bm{h}_{S} = (10, 10)$. We create the shortest path through the feature space to reach the point (5, 5), which consists of directly proportional changes in both features. Above the path, we see the linear secant (orange, dashed) and the non-linear prediction function (black). Right: The multivariate change in feature values can be parameterized as a percentage $t$ of the step size $\bm{h}_{S}$. The deviation between the prediction function and the linear secant, as well as the deviation between the prediction function and mean prediction, both correspond to a line integral.