@@ -56,7 +56,7 @@ def rename_approval_candidates(
56
56
57
57
58
58
def resampling_filter (
59
- votes : list [set [int ]], phi : float , seed : int = None
59
+ votes : list [set [int ]], num_candidates , phi : float , p , seed : int = None
60
60
) -> list [set [int ]]:
61
61
"""
62
62
Returns votes with added resampling filter.
@@ -65,8 +65,12 @@ def resampling_filter(
65
65
----------
66
66
votes : list[set[int]]
67
67
Approval votes.
68
+ num_candidates : int
69
+ Number of Candidates.
68
70
phi : float
69
71
Noise parameter.
72
+ p : float
73
+ Resampling model parameter, denoting the average vote length.
70
74
seed : int
71
75
Seed for numpy random number generator.
72
76
@@ -76,8 +80,8 @@ def resampling_filter(
76
80
Approval votes.
77
81
"""
78
82
79
- return [_resampling_filter_vote (votes [i ], phi , seed ) for i in range (len (votes ))]
83
+ return [_resampling_filter_vote (votes [i ], num_candidates , phi , p , seed ) for i in range (len (votes ))]
80
84
81
85
82
- def _resampling_filter_vote (vote , phi : float , seed : int = None ):
83
- return resampling (1 , len ( vote ) , phi , seed , central_vote = vote )[0 ]
86
+ def _resampling_filter_vote (vote , num_candidates , phi : float , p , seed : int = None ):
87
+ return resampling (1 , num_candidates , phi , p , seed , central_vote = vote )[0 ]
0 commit comments