Internal function used by light_profile
to calculate ALE profiles.
ale_profile(
x,
v,
breaks = NULL,
n_bins = 11,
cut_type = c("equal", "quantile"),
counts = TRUE,
counts_weighted = FALSE,
pred = NULL,
evaluate_at = NULL,
indices = NULL,
n_max = 1000,
seed = NULL,
two_sided = FALSE,
calibrate = TRUE,
...
)
A tibble containing results.
An object of class flashlight
.
The variable to be profiled.
Cut breaks for a numeric v
. Only used if no evaluate_at
is specified.
Maxmium number of unique values to evaluate for numeric v
. Only used if no evaluate_at
is specified.
For the default "equal", bins of equal width are created for v
by pretty
. Choose "quantile" to create quantile bins.
Should counts be added?
If counts
is TRUE: Should counts be weighted by the case weights? If TRUE, the sum of w
is returned by group.
Optional vector with predictions.
Vector with values of v
used to evaluate the profile. Only relevant for type = "partial dependence".
A vector of row numbers to consider.
Maximum number of ICE profiles to calculate within interval (not within data).
Integer random seed passed to light_ice
.
Standard ALE profiles are calculated via left derivatives. Set to TRUE if two-sided derivatives should be calculated. Only works for continuous v
. More specifically: Usually, local effects at value x are calculated using points between x-e and x. Set ale_two_sided = TRUE
to use points between x-e/2 and x+e/2.
Should values be calibrated based on average preditions? Default is TRUE.
Other arguments passed to this function (currently unused).