This is the official repository for the R code for the R package ICEbox --- Individual Conditional Expectation (ICE) plots, a tool for visualizing the model estimated by any supervised learning algorithm. Classical partial dependence plots (PDPs) help visualize the average partial relationship between the predicted response and one or more features. In the presence of substantial interaction effects, the partial response relationship can be heterogeneous and an average curve, such as the PDP, can obfuscate the complexity of the modeled relationship. Accordingly, ICE plots refine the partial dependence plot by graphing the functional relationship between the predicted response and the feature for individual observations. Specifically, ICE plots highlight the variation in the fitted values across the range of a covariate, suggesting where and to what extent they may exist. In addition to providing a plotting suite for exploratory analysis, we include a visual test for additive structure in the data generating model. Through simulated examples and real data sets, we demonstrate how ICE plots can shed light on estimated models in ways PDPs cannot.
For a full writeup of the method with examples, see Goldstein et al (2015) or the free arxiv version which is largely the same.
Install the CRAN release with:
install.packages("ICEbox")Or install the latest R-universe build with:
install.packages(
"ICEbox",
repos = c(
kapelner = "https://kapelner.r-universe.dev",
CRAN = "https://cloud.r-project.org"
)
)The package website is at https://kapelner.github.io/ICEbox/.
To cite the software and the methodological article, run:
citation("ICEbox")The methodological article is Goldstein, Kapelner, Bleich, and Pitkin (2015), “Peeking Inside the Black Box: Visualizing Statistical Learning With Plots of Individual Conditional Expectation,” https://doi.org/10.1080/10618600.2014.907095. The permanent CRAN package DOI is https://doi.org/10.32614/CRAN.package.ICEbox.
ICEbox is available under either the GNU General Public License version 2 or version 3, at your option. See LICENSE for details.
January, 2026 - version 1.2 released
- upgraded to ggplot2
- rotated the additivityLineup test into the package (was previously an experimental script) as well as its backfitter function
- speedups via data.table
- speedups via optional parallelization for ice, dice, clusterICE
- speedup via Savitzky-Golay Filter for numerical derivative calculation implemented in Rcpp
- other speedups in Rcpp
- added Roxygen documentation
- checkmate checks for all functions' arguments
- tests
- benchmark vs previous version