Naive
permutation_exact_shapley(u, *, progress=True)
¶
Computes the exact Shapley value using the formulation with permutations:
See Data valuation for details.
When the length of the training set is > 10 this prints a warning since the computation becomes too expensive. Used mostly for internal testing and simple use cases. Please refer to the Monte Carlo approximations for practical applications.
PARAMETER | DESCRIPTION |
---|---|
u |
Utility object with model, data, and scoring function
TYPE:
|
progress |
Whether to display progress bars for each job.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ValuationResult
|
Object with the data values. |
Source code in src/pydvl/value/shapley/naive.py
combinatorial_exact_shapley(u, *, n_jobs=1, config=ParallelConfig(), progress=False)
¶
Computes the exact Shapley value using the combinatorial definition.
See Data valuation for details.
Note
If the length of the training set is > n_jobs*20 this prints a warning because the computation is very expensive. Used mostly for internal testing and simple use cases. Please refer to the Monte Carlo approximations for practical applications.
PARAMETER | DESCRIPTION |
---|---|
u |
Utility object with model, data, and scoring function
TYPE:
|
n_jobs |
Number of parallel jobs to use
TYPE:
|
config |
Object configuring parallel computation, with cluster address, number of cpus, etc.
TYPE:
|
progress |
Whether to display progress bars for each job.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ValuationResult
|
Object with the data values. |
Source code in src/pydvl/value/shapley/naive.py
Created: 2023-12-21