pydvl.value.least_core.naive
¶
exact_least_core
¶
exact_least_core(
u: Utility,
*,
non_negative_subsidy: bool = False,
solver_options: Optional[dict] = None,
progress: bool = True
) -> ValuationResult
Computes the exact Least Core values.
Note
If the training set contains more than 20 instances a warning is printed because the computation is very expensive. This method is mostly used for internal testing and simple use cases. Please refer to the Monte Carlo method for practical applications.
The least core is the solution to the following Linear Programming problem:
Where \(N = \{1, 2, \dots, n\}\) are the training set's indices.
PARAMETER | DESCRIPTION |
---|---|
u |
Utility object with model, data, and scoring function
TYPE:
|
non_negative_subsidy |
If True, the least core subsidy \(e\) is constrained to be non-negative.
TYPE:
|
solver_options |
Dictionary of options that will be used to select a solver and to configure it. Refer to the cvxpy's documentation for all possible options. |
progress |
If True, shows a tqdm progress bar
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ValuationResult
|
Object with the data values and the least core value. |
Source code in src/pydvl/value/least_core/naive.py
lc_prepare_problem
¶
Prepares a linear problem with all subsets of the data Use this to separate the problem preparation from the solving with lc_solve_problem(). Useful for parallel execution of multiple experiments.
See exact_least_core() for argument descriptions.