Plot interaction partial dependence plots
gpb.plot.part.dep.interact(model, data, variables, n.pt.per.var = 20,
subsample = pmin(1, n.pt.per.var^2 * 100/nrow(data)),
discrete.variables = c(FALSE, FALSE), which.class = NULL,
type = "filled.contour", nlevels = 20, xlab = variables[1],
ylab = variables[2], zlab = "", main = "", return_plot_data = FALSE,
...)
A list
with three entries for creating the partial dependence plot:
the first two entries are vector
s with x and y coordinates.
The third is a two-dimensional matrix
of dimension c(length(x), length(y))
with z-coordinates. This is only returned if return_plot_data==TRUE
A gpb.Booster
model object
A matrix
with data for creating partial dependence plots
A vector
of length two of type string
with
names of the columns or integer
with indices of the columns in
data
for which an interaction dependence plot is created
Number of grid points per variable (used only if a variable is not discrete) For continuous variables, the two-dimensional grid for the interaction plot has dimension c(n.pt.per.var, n.pt.per.var)
Fraction of random samples in data
to be used for calculating the partial dependence plot
A vector
of length two of type boolean
.
If an entry is TRUE, the evaluation grid of the corresponding variable is set to the unique values of the variable
An integer
indicating the class in multi-class
classification (value from 0 to num_class - 1)
A character
string indicating the type of the plot.
Supported values: "filled.contour" and "contour"
Parameter passed to the filled.contour
or contour
function
Parameter passed to the filled.contour
or contour
function
Parameter passed to the filled.contour
or contour
function
Parameter passed to the filled.contour
or contour
function
Parameter passed to the filled.contour
or contour
function
A boolean
. If TRUE, the data for creating the partial dependence plot is returned
Additional parameters passed to the filled.contour
or contour
function
Fabio Sigrist
# \donttest{
library(gpboost)
data(GPBoost_data, package = "gpboost")
gp_model <- GPModel(group_data = group_data[,1], likelihood = "gaussian")
gpboost_model <- gpboost(data = X,
label = y,
gp_model = gp_model,
nrounds = 16,
learning_rate = 0.05,
max_depth = 6,
min_data_in_leaf = 5,
verbose = 0)
gpb.plot.part.dep.interact(gpboost_model, X, variables = c(1,2))
# }
Run the code above in your browser using DataLab