Montecarlo
montecarlo_least_core(u, n_iterations, *, n_jobs=1, config=ParallelConfig(), non_negative_subsidy=False, solver_options=None, progress=False, seed=None)
¶
Computes approximate Least Core values using a Monte Carlo approach.
Where:
- \(U(2^N)\) is the uniform distribution over the powerset of \(N\).
- \(m\) is the number of subsets that will be sampled and whose utility will be computed and used to compute the data values.
PARAMETER | DESCRIPTION |
---|---|
u |
Utility object with model, data, and scoring function
TYPE:
|
n_iterations |
total number of iterations to use
TYPE:
|
n_jobs |
number of jobs across which to distribute the computation
TYPE:
|
config |
Object configuring parallel computation, with cluster address, number of cpus, etc.
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 cvxpy's documentation for all possible options. |
progress |
If True, shows a tqdm progress bar
TYPE:
|
seed |
Either an instance of a numpy random number generator or a seed for it.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
ValuationResult
|
Object with the data values and the least core value. |
Source code in src/pydvl/value/least_core/montecarlo.py
mclc_prepare_problem(u, n_iterations, *, n_jobs=1, config=ParallelConfig(), progress=False, seed=None)
¶
Prepares a linear problem by sampling 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 montecarlo_least_core for argument descriptions.