pydvl.value.least_core
¶
New in version 0.4.0
This package holds all routines for the computation of Least Core data values.
Please refer to Data valuation for an overview.
In addition to the standard interface via compute_least_core_values(), because computing the Least Core values requires the solution of a linear and a quadratic problem after computing all the utility values, there is the possibility of performing each step separately. This is useful when running multiple experiments: use lc_prepare_problem() or mclc_prepare_problem() to prepare a list of problems to solve, then solve them in parallel with lc_solve_problems().
Note that mclc_prepare_problem() is parallelized itself, so preparing the problems should be done in sequence in this case. The solution of the linear systems can then be done in parallel.
compute_least_core_values
¶
compute_least_core_values(
u: Utility,
*,
n_jobs: int = 1,
n_iterations: Optional[int] = None,
mode: LeastCoreMode = LeastCoreMode.MonteCarlo,
non_negative_subsidy: bool = False,
solver_options: Optional[dict] = None,
progress: bool = False,
**kwargs
) -> ValuationResult
Umbrella method to compute Least Core values with any of the available algorithms.
See Data valuation for an overview.
The following algorithms are available. Note that the exact method can only work with very small datasets and is thus intended only for testing.
exact
: uses the complete powerset of the training set for the constraints combinatorial_exact_shapley().montecarlo
: uses the approximate Monte Carlo Least Core algorithm. Implemented in montecarlo_least_core().
PARAMETER | DESCRIPTION |
---|---|
u |
Utility object with model, data, and scoring function
TYPE:
|
n_jobs |
Number of jobs to run in parallel. Only used for Monte Carlo Least Core.
TYPE:
|
n_iterations |
Number of subsets to sample and evaluate the utility on. Only used for Monte Carlo Least Core. |
mode |
Algorithm to use. See LeastCoreMode for available options.
TYPE:
|
non_negative_subsidy |
If True, the least core subsidy \(e\) is constrained to be non-negative.
TYPE:
|
solver_options |
Optional dictionary of options passed to the solvers. |
RETURNS | DESCRIPTION |
---|---|
ValuationResult
|
Object with the computed values. |
New in version 0.5.0