opendataval.dataval.DataShapley#
- class opendataval.dataval.DataShapley(*args, **kwargs)#
Data Shapley implementation.
References#
Parameters#
- samplerSampler, optional
Sampler used to compute the marginal contributions. Can be found in
sampler, by default uses *args, **kwargs forGrTMCSampler.
Methods
__init__([sampler])compute_weight()Compute weights (uniform) 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
Evaluatorsdata_valuesCached data values.