opendataval.dataval.TMCSampler#

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

TMCShapley sampler for semivalue-based methods of computing data values.

Evaluators that share marginal contributions should share a sampler.

References#

Parameters#

mc_epochsint, optional

Number of outer epochs of MCMC sampling, by default 1000

min_cardinalityint, optional

Minimum cardinality of a training set, must be passed as kwarg, by default 5

cache_namestr, optional

Unique cache_name of the model to cache marginal contributions, set to None to disable caching, by default “” which is set to a unique value for a object

random_stateRandomState, optional

Random initial state, by default None

__init__(mc_epochs: int = 1000, min_cardinality: int = 5, cache_name: str | None = '', random_state: RandomState | None = None)#

Methods

__init__([mc_epochs, min_cardinality, ...])

compute_marginal_contribution(*args, **kwargs)

Computes marginal contribution through TMC Shapley.

set_coalition(coalition)

Initializes storage to find marginal contribution of each data point

set_evaluator(value_func)

Sets the evaluator function to evaluate the utility of a coalition

Attributes

CACHE

Cached marginal contributions.