mu=0 results in mu=25
mrkvicka22 opened this issue · comments
Describe the bug
mu=0 results in mu=25. Same goes for sigma and potentially other optional parameters that I did not investigate.
To Reproduce
To reproduce simply do:
model = PlackettLuce()
player = model.rating(mu=0,sigma=1)
print(player.mu) # prints 25.0 but expected is 0.0
Expected behavior
When mu is not None
then take whatever the user provides.
Additional context
This can lead to unexpected behaviour AND wrong predictions. The issue happens in the wrong initialization of Rating
objects.
# Replace this:
return self.PlackettLuceRating(mu or self.mu, sigma or self.sigma, name)
# With something more like this:
if self.mu is None:
return self.PlackettLuceRating(mu,...)
else:
return self.PlackettLuceRating(self.mu, ...)
# and the same for other parameters