opendataval.dataval.BetaShapley#

class opendataval.dataval.BetaShapley(*args, **kwargs)#

Beta Shapley implementation. Must specify alpha/beta values for beta function.

References#

Parameters#

samplerSampler, optional

Sampler used to compute the marginal contributions. Can be found in sampler, by default uses *args, **kwargs for GrTMCSampler.

alphaint, optional

Alpha parameter for beta distribution used in the weight function, by default 4

betaint, optional

Beta parameter for beta distribution used in the weight function, by default 1

__init__(sampler: Sampler | None = None, alpha: int = 4, beta: int = 1, *args, **kwargs)#

Methods

__init__([sampler, alpha, beta])

compute_weight()

Compute weights for each cardinality of training set.

evaluate(y, y_hat)

Evaluate performance of the specified metric between label and predictions.

evaluate_data_values()

Return data values for each training data point.

input_data(x_train, y_train, x_valid, y_valid)

Store and transform input data for semi-value samplers.

input_fetcher(fetcher)

Input data from a DataFetcher object.

input_metric(metric)

Input the evaluation metric.

input_model(pred_model)

Input the prediction model.

input_model_metric(pred_model, metric)

Input the prediction model and the evaluation metric.

setup(fetcher[, pred_model, metric])

Inputs model, metric and data into Data Evaluator.

train(fetcher[, pred_model, metric])

Store and transform data, then train model to predict data values.

train_data_values(*args, **kwargs)

Uses sampler to trains model to find marginal contribs and data values.

Attributes

Evaluators

data_values

Cached data values.