Learn R Programming

iml (version 0.3.0)

plot.Ice: Plot ICE (Individual Conditional Expectation)

Description

plot.Ice() plots the individiual expectation results from an Ice object.

Usage

# S3 method for Ice
plot(x, rug = TRUE)

Arguments

x

An Ice R6 object

rug

[logical] Should a rug be plotted to indicate the feature distribution?

Value

ggplot2 plot object

See Also

Ice

Examples

Run this code
# NOT RUN {
if (require("randomForest")) {

data("Boston", package  = "MASS")
rf = randomForest(medv ~ ., data = Boston, ntree = 50)
mod = Predictor$new(rf, data = Boston)

# Compute the individual conditional expectations for the first feature
ice = Ice$new(mod, feature = "crim")

# Plot the results directly
plot(ice)
}
# }

Run the code above in your browser using DataLab