shapiq.utils.split_subsets_budgetΒΆ
- shapiq.utils.split_subsets_budget(order, n, budget, sampling_weights)[source]ΒΆ
Determines which subset sizes can be computed explicitly and which sizes need to be sampled.
Given a computational budget, determines the complete subsets that can be computed explicitly and the corresponding incomplete subsets that need to be estimated via sampling.
- Parameters:
- Return type:
- Returns:
complete subsets, incomplete subsets, remaining budget
Examples
>>> split_subsets_budget(order=1, n=6, budget=100, sampling_weights=np.ones(shape=(6,))) ([1, 5, 2, 4, 3], [], 38)
>>> split_subsets_budget(order=1, n=6, budget=60, sampling_weights=np.ones(shape=(6,))) ([1, 5, 2, 4], [3], 18)
>>> split_subsets_budget(order=1, n=6, budget=100, sampling_weights=np.zeros(shape=(6,))) ([], [1, 2, 3, 4, 5], 100)