Skip to content

Commit 41a0263

Browse files
committed
Rename, formatting and bibliography in docstring
1 parent 99bdbe3 commit 41a0263

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

docs/30-data-valuation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ values in pyDVL. First construct the dataset and utility, then call
260260
dataset = Dataset(...)
261261
utility = Utility(data, model)
262262
df = compute_shapley_values(
263-
u=utility, mode="owen", max_iterations=4, max_q=200
264-
)
263+
u=utility, mode="owen", max_iterations=4, max_q=200
264+
)
265265
266266
There are more details on Owen
267267
sampling, and its variant *Antithetic Owen Sampling* in the documentation for the
@@ -293,8 +293,8 @@ efficient enough to be useful in some applications.
293293
data = Dataset(...)
294294
utility = Utility(model, data)
295295
df = compute_shapley_values(
296-
u=utility, mode="truncated_montecarlo", max_iterations=100
297-
)
296+
u=utility, mode="truncated_montecarlo", max_iterations=100
297+
)
298298
299299
300300
Exact Shapley for KNN

src/pydvl/value/shapley/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class ShapleyMode(str, Enum):
3939
PermutationMontecarlo = "permutation_montecarlo"
4040
TruncatedMontecarlo = "truncated_montecarlo"
4141
Owen = "owen"
42-
OwenAntithetic = "owen_anti"
42+
OwenAntithetic = "owen_antithetic"
4343
KNN = "knn"
4444

4545

src/pydvl/value/shapley/knn.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def knn_shapley(
1919
) -> OrderedDict[str, float]:
2020
"""Computes exact Shapley values for a KNN classifier.
2121
22-
This implements the method described in [1]. It exploits the local structure
23-
of K-Nearest Neighbours to reduce the number of calls to the utility
24-
function to a constant number per index, thus reducing computation time to
25-
$O(n)$
22+
This implements the method described in :footcite:t:`jia_efficient_2019a`.
23+
It exploits the local structure of K-Nearest Neighbours to reduce the number
24+
of calls to the utility function to a constant number per index, thus
25+
reducing computation time to $O(n)$.
2626
2727
:param data: A :class:`pydvl.utils.dataset.Dataset` object with a training /
2828
test split.
@@ -37,11 +37,7 @@ def knn_shapley(
3737
3838
.. rubric:: References
3939
40-
[1]: Jia, Ruoxi, David Dao, Boxin Wang, Frances Ann Hubis, Nezihe Merve
41-
Gurel, Bo Li, Ce Zhang, Costas Spanos, and Dawn Song.
42-
‘Efficient Task-Specific Data Valuation for Nearest Neighbor Algorithms’.
43-
Proceedings of the VLDB Endowment 12, no. 11 (1 July 2019): 1610–23.
44-
https://doi.org/10.14778/3342263.3342637.
40+
.. footbibliography::
4541
4642
.. versionadded:: 0.1.0
4743

0 commit comments

Comments
 (0)