View source: R/FeatureEffect.R
plot.FeatureEffect | R Documentation |
plot.FeatureEffect()
plots the results of a FeatureEffect object.
## S3 method for class 'FeatureEffect'
plot(x, rug = TRUE, show.data = FALSE, ylim = NULL)
x |
A FeatureEffect object. |
rug |
logical |
show.data |
( |
ylim |
( |
ggplot2 plot object
FeatureEffect
# We train a random forest on the Boston dataset:
if (require("randomForest")) {
data("Boston", package = "MASS")
rf <- randomForest(medv ~ ., data = Boston, ntree = 50)
mod <- Predictor$new(rf, data = Boston)
# Compute the ALE for the first feature
eff <- FeatureEffect$new(mod, feature = "crim")
# Plot the results directly
plot(eff)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.