Assisted Model Building, using Surrogate Black-Box Models to Train Interpretable Spline Based Additive Models

Builds generalized linear model with automatic data transformation. The 'xspliner' helps to build simple, interpretable models that inherits informations provided by more complicated ones. The resulting model may be treated as explanation of provided black box, that was supplied prior to the algorithm.

xspliner's pipeline: model %>% xspline(...) and analyze

Installation from CRAN


Installation from Github



Reference Manual


# fitting random forest model
model_rf <- randomForest(cmedv ~ lstat + ptratio + age, data = boston)

# building GLM (with standard black box response - Partial Dependence)
xspliner <- xspline(model_rf)

# see standard glm results

# see ptratio variable transformation
plot(xspliner, "ptratio")

# compare xspliner and base model responses
plot(xspliner, model = model_rf, data = boston)

For more info check project vignettes or examples.

Further work

See github issues


xspliner 0.0.2

  • Specify parameters hierarchy
  • Use of S3
  • Add DALEX integration
  • More variations on building xspliner
  • More examples
  • Add plot and summary method
  • Complete package documentation
  • Export only main package functions, non-exported ones moved to utils
  • Basic functionality for xspline.formula method

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.0.4 by Krystian Igras, a year ago

Report a bug at

Browse source code at

Authors: Krystian Igras [aut, cre] , Przemyslaw Biecek [aut, ths]

Documentation:   PDF Manual  

GPL license

Imports stats, pdp, dplyr, ggplot2, mgcv, magrittr, purrr, tidyr, pROC

Suggests ALEPlot, factorMerger, testthat, knitr, rmarkdown, ResourceSelection, randomForest, e1071, caret, breakDown, DALEX, xgboost, gridExtra, grid, ISLR

See at CRAN