mcr_set: Compute MR & MCR

Description Usage Arguments Value

Description

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.

Usage

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, ...)

Arguments

model

model for which MR should be evaluated. If applicable, this should match the output of minimize_weighted_loss, and be an input for get_loss.

precomputed

output from precompute_mcr_objects_and_functions

...

passed to precompute_mcr_objects_and_functions (and getMCR_internal for advanced options).

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 and get_loss must be set.

minimize_weighted_loss

(optional) a function with named inputs X, y, case.weights, and (optionally) start. The function should export a model object which minimizes the sum of losses for the dataset (y,X). Any model format is acceptable, as long as it can be read by get_loss. The (optional) input start should also take the same format as the output of minimize_weighted_loss. Regularization constraints should also be accounted for in this function.

get_loss

(optional) a function which takes named inputs model, y, and X, and returns a vector of losses. The input model should be in the same format of the returned value of minimize_weighted_loss.

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 get_full_sample.

loop_ind_args

A list of arguments not changing over the binary search (e.g., crossprod(X)).

eps

performance threshold for MCR, on an absolute scale.

Value

precompute_mcr_objects_and_functions returns a list containing

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).


aaronjfisher/mcr documentation built on Jan. 2, 2020, 4:38 p.m.