class svvamp.GeneratorProfileNoise(base_profile, relative_noise=0.0, absolute_noise=0.0, sort_voters=False)[source]

Profile generator adding noise to a given profile

Parameters:
  • base_profile (Profile) – The initial profile.

  • relative_noise (number) – The relative noise.

  • absolute_noise (number) – The absolute noise

  • sort_voters (bool) – This argument is passed to Profile.

Notes

We compute total_noise = absolute_noise + relative_noise * amplitude, where amplitude is the difference between the lowest and the highest utility. Then to each preferences_ut[v, c], a random noise is added which is drawn independently and uniformly in the interval [- total_noise, total_noise].

Examples

>>> generator = GeneratorProfileNoise(base_profile=Profile(preferences_ut=[[5, 1, 2], [4, 10, 1]]),
...                                   absolute_noise=.1)
>>> profile = generator()
>>> profile.preferences_rk.shape
(2, 3)