pydvl.valuation.methods.semivalue
¶
This module contains the base class for all semi-value valuation methods.
A semi-value is any valuation function with the form:
where \(U\) is the utility, and the coefficients \(w(k)\) satisfy the property:
This is the largest class of marginal-contribution-based valuation methods. These compute the value of a data point by evaluating the change in utility when the data point is removed from one or more subsets of the data.
SemivalueValuation
¶
SemivalueValuation(
utility: UtilityBase,
sampler: IndexSampler,
is_done: StoppingCriterion,
progress: dict[str, Any] | bool = False,
)
Bases: Valuation
Abstract class to define semi-values.
Implementations must only provide the coefficient()
method, corresponding
to the semi-value coefficient.
Note
For implementation consistency, we slightly depart from the common definition of semi-values, which includes a factor \(1/n\) in the sum over subsets. Instead, we subsume this factor into the coefficient \(w(k)\). TODO: see ...
PARAMETER | DESCRIPTION |
---|---|
utility |
Object to compute utilities.
TYPE:
|
sampler |
Sampling scheme to use.
TYPE:
|
is_done |
Stopping criterion to use.
TYPE:
|
progress |
Whether to show a progress bar. |
Source code in src/pydvl/valuation/methods/semivalue.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 before returning it.
TYPE:
|
Returns: The result of the valuation.