Learn R Programming

edarf (version 1.1.0)

plot_pd: Plot partial dependence from random forests

Description

Plot partial dependence from random forests

Usage

plot_pd(pd, facet = NULL)

Arguments

pd
object of class c("pd", "data.frame") as returned by partial_dependence
facet
a character vector indicating the variable that should be used to facet on if interaction is plotted. If not specified the variable with less unique values is chosen.

Value

a ggplot2 object

Examples

Run this code
library(randomForest)
library(edarf)
data(iris)
fit <- randomForest(Species ~ ., iris)
pd <- partial_dependence(fit, "Petal.Width", data = iris)
plot_pd(pd)

Run the code above in your browser using DataLab