
Plot partial dependence plots
gpb.plot.partial.dependence(model, data, variable, n.pt = 100,
subsample = pmin(1, n.pt * 100/nrow(data)), discrete.x = FALSE,
which.class = NULL, xlab = deparse(substitute(variable)), ylab = "",
type = if (discrete.x) "p" else "b", main = "",
return_plot_data = FALSE, ...)
A two-dimensional matrix
with data for creating the partial dependence plot.
This is only returned if return_plot_data==TRUE
A gpb.Booster
model object
A matrix
with data for creating partial dependence plots
A string
with a name of the column or an integer
with an index of the column in data
for which a dependence plot is created
Evaluation grid size (used only if x is not discrete)
Fraction of random samples in data
to be used for calculating the partial dependence plot
A boolean
. If TRUE, the evaluation grid is set to the unique values of x
An integer
indicating the class in multi-class classification (value from 0 to num_class - 1)
Parameter passed to plot
Parameter passed to plot
Parameter passed to plot
Parameter passed to plot
A boolean
. If TRUE, the data for creating the partial dependence plot is returned
Additional parameters passed to plot
Fabio Sigrist (adapted from a version by Michael Mayer)
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,
objective = "regression_l2",
verbose = 0)
gpb.plot.partial.dependence(gpboost_model, X, variable = 1)
Run the code above in your browser using DataLab