pydvl.valuation.methods.delta_shapley
¶
This module implements the \(\delta\)-Shapley valuation method.
The value of a point \(i\) is defined as:
where \(l\) and \(u\) are the lower and upper bounds of the size of the subsets to sample from, and \(w(k)\) is the weight of a subset of size \(k\) in the complement of \(\{i\}\), and is given by:
DeltaShapleyValuation
¶
DeltaShapleyValuation(
utility: UtilityBase,
is_done: StoppingCriterion,
lower_bound: int,
upper_bound: int,
seed: Seed | None = None,
skip_converged: bool = False,
progress: bool = False,
)
Bases: SemivalueValuation
Computes \(\delta\)-Shapley values.
\(\delta\)-Shapley does not accept custom samplers. Instead, it uses a StratifiedSampler with a lower and upper bound on the size of the sets to sample from.
PARAMETER | DESCRIPTION |
---|---|
utility
|
Object to compute utilities.
TYPE:
|
is_done
|
Stopping criterion to use.
TYPE:
|
lower_bound
|
The lower bound of the size of the subsets to sample from.
TYPE:
|
upper_bound
|
The upper bound of the size of the subsets to sample from.
TYPE:
|
seed
|
The seed for the random number generator used by the sampler.
TYPE:
|
progress
|
Whether to show a progress bar. If a dictionary, it is passed to
TYPE:
|
skip_converged
|
Whether to skip converged indices, as determined by the
stopping criterion's
TYPE:
|
Source code in src/pydvl/valuation/methods/delta_shapley.py
values
¶
values(sort: bool = False) -> ValuationResult
Returns a copy of the valuation result.
The valuation must have been run with fit()
before calling this method.
PARAMETER | DESCRIPTION |
---|---|
sort
|
Whether to sort the valuation result by value before returning it.
TYPE:
|
Returns: The result of the valuation.