Description Usage Arguments Value
Main functions for computing model reliance (MR) and model class reliance (MCR). For further details, see getMCR_internal
. The function precompute_mcr_objects_and_functions
computes objects that are used within the MCR search procedure.
1 2 3 4 5 6 7 | get_MR_general(model, precomputed = NA, ...)
precompute_mcr_objects_and_functions(X, y, p1, model_class_loss = NULL,
minimize_weighted_loss = NULL, get_loss = NULL, nrep_sample = 2,
loop_ind_args = NULL)
get_empirical_MCR(eps, precomputed = NA, ...)
|
model |
model for which MR should be evaluated. If applicable, this should match the output of |
precomputed |
output from |
... |
passed to |
X |
a matrix or dataframe of covariates |
y |
outcome vector |
p1 |
numeric index marking which columns of X to compute importance for. |
model_class_loss |
(optional) Signify a preset model class and loss function. This package currently supports 'linear_mse' for linear regression with the squared error loss; 'kernel_mse' for regression in a reproducing kernel Hilbert space, with the squared error loss; and 'linear_hinge' for linear classification with the hinge loss (y = -1 or 1). If this option is not set, both |
minimize_weighted_loss |
(optional) a function with named inputs |
get_loss |
(optional) a function which takes named inputs |
nrep_sample |
an integer between 2 and length(y) determining the level of approximation for empirical MR. If nrep_sample=2, e_divide is used. If nrep_sample=length(y), all combinations are computed. See |
loop_ind_args |
A list of arguments not changing over the binary search (e.g., |
eps |
performance threshold for MCR, on an absolute scale. |
precompute_mcr_objects_and_functions
returns a list containing
suff_stats
- a list of precomuted objects that do not change over iterations of the MCR binary search loop.
get_ld_h_min
- (advanced or internal use) a function that minimizes of equations in the form of h_γ, which has loop-dependent ("ld") arguments. Takes arguments loop_dep_args
(optional), suff_stats
(above), s
(-1 for MCR-, +1 for MCR+), and gam
(coefficient in h_γ, see details in main paper). If only computing MR (see get_MR_general), this element may be NULL.
get_MR
- a function taking model
and suff_stats
as input (see above), and which computes the MR of the model using the precomputed object suff_stats
.
get_empirical_MCR
returns a list containing the MCR range, the epsilon value, and more detailed results (minus
and plus
) for each end of the MCR interval (see getMCR_internal
for more details).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.