Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix randomization #182

Closed
eu9ene opened this issue Dec 16, 2020 · 0 comments · Fixed by #184
Closed

Fix randomization #182

eu9ene opened this issue Dec 16, 2020 · 0 comments · Fixed by #184
Assignees
Labels

Comments

@eu9ene
Copy link
Contributor

eu9ene commented Dec 16, 2020

The exception has occurred in prod for client id hash 0ace1ca2a3519332ab93e76a049fe74091fa8fc9063399caa8545dd23f93de5c and many others.

"Traceback (most recent call last):
File "/opt/conda/envs/taar-37/lib/python3.7/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/opt/conda/envs/taar-37/lib/python3.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/opt/conda/envs/taar-37/lib/python3.7/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/opt/conda/envs/taar-37/lib/python3.7/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/opt/conda/envs/taar-37/lib/python3.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/opt/conda/envs/taar-37/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functionsrule.endpoint
File "/app/taar/plugin.py", line 229, in recommendations
client_id=client_id, limit=TAAR_MAX_RESULTS, extra_data=extra_data
File "/opt/conda/envs/taar-37/lib/python3.7/site-packages/markus/main.py", line 510, in _timer_decorator
return fun(*args, **kwargs)
File "/app/taar/recommenders/recommendation_manager.py", line 109, in recommend
results = reorder_guids(results, limit)
File "/app/taar/recommenders/randomizer.py", line 42, in reorder_guids
choices = np.random.choice(guids, size=size, replace=False, p=probabilities)
File "mtrand.pyx", line 922, in numpy.random.mtrand.RandomState.choice
ValueError: probabilities are not non-negative

@eu9ene eu9ene self-assigned this Dec 16, 2020
@eu9ene eu9ene added the bug label Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant