.pd | R Documentation |
This is a barebone implementation of Friedman's partial dependence
intended for developers. To get more information on partial dependence, see
partial_dependence()
.
.pd(
object,
v,
data,
grid,
pred_fun = stats::predict,
trafo = NULL,
which_pred = NULL,
w = NULL,
...
)
object |
Fitted model. |
v |
Variable name in |
data |
Matrix or data.frame. |
grid |
Vector or factor of values to calculate partial dependence for. |
pred_fun |
Prediction function, by default |
trafo |
How should predictions be transformed?
A function or |
which_pred |
If the predictions are multivariate: which column to pick
(integer or column name). By default |
w |
Optional vector with case weights. |
... |
Further arguments passed to |
Vector of partial dependence values in the same order as grid
.
Friedman, Jerome H. 2001, Greedy Function Approximation: A Gradient Boosting Machine. Annals of Statistics 29 (5): 1189-1232. doi:10.1214/aos/1013203451.
partial_dependence()
fit <- lm(Sepal.Length ~ ., data = iris)
.pd(fit, "Sepal.Width", data = iris, grid = hist(iris$Sepal.Width)$mids)
.pd(fit, "Species", data = iris, grid = levels(iris$Species))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.