Closed stsievert closed 9 years ago
Also, when I download under DuelingBandits or Tuple, I get an error. Apparently this issue was seen beforehand... in DuelingBanditsPureExploration.py.
for index in response['target_indices']:
targets[index['label']] = index
# Check for the index winner in this response
# Shouldn't there be a target_winner? This is weird.
if 'index_winner' in response.keys() and response["index_winner"] == index['index']:
target_winner = index
Because this throws an error, this means that the participant data cannot be downloaded
Getting the participant response data fails for both DuelingBandits and Tuple in the code snippet above, 'index_winner'
is not always in response.keys()
.
That is, when I run Tuple or DuelingBandits I essentially have done the following:
>>> # Tuple
>>> print ['index_winner' in res.keys() for res in response_list]
[True, True, True, True, True, True, True, True, False, False, False, True, False]
>>>
>>> # DuelingBandits
>>> print ['index_winner' in res.keys() for res in response_list]
>>> [False, True, True, True, True, True, False, True, False, False, False, False, True, False, False, False, True, True, True, False, True, True, False, False, False, True, True, True, False, False, True, False, False, False, False, False, True, False, False, False, True, False, False, False, True, False, False, True, True, False, True, True, False, False, False, False, False, False, True, True, True, False, True, False, True, False, True, True, True, False, False, True, True, True, False, False, True, True, False, True, False, True, False, True, True, False, True, True, True, False, True, True, True, True, True, True, True, True, True, True]
When the function tries to append the index winner the variable target_winner
is undefined. Specifically, it uses this line:
line.append(target_winner['target']['target_id'])
which throws an error because target_winner
is undefined. The user sees that no participant data is downloaded and an error page.
This is a part of a response from the backend. I can get around this issue to allow the participant data to be downloaded, but we should address why we're getting this response from the backend.
It's fine if there is no target_winner
. This is due to the fact that some queries may not get answered. You need to only return queries that did get answered.
aab105b8f1f0222466b0b9de00a90562637ce242 only closes this issue for DuelingBandits. This commit makes identical changes to both DuelingBandits.py and TupleBanditsPureExploration.py but I'm not going to touch the tuple anymore; we have more time-sensitive issues on the table.
This commit does the following:
When downloading the participant data with this button:
the CSV looks something like
We want this CSV to be formatted like so -- just remove the underscore