This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgs <- c("party", "parallel") | |
invisible(lapply(pkgs, require, character.only = TRUE)) | |
partial_dependence <- function(fit, ivar, cores = 1, ...) { | |
## calculates the partial dependence of the response on explanatory variable(s) | |
## fit must be a party object | |
## ivar must be a character vector of length >= 1 all of which | |
## exist in the dataframe used to fit the model | |
## if the length of ivar > 1, joint dependence is calculated | |
df <- data.frame(get("input", fit@data@env), get("response", fit@data@env)) |
NewerOlder