-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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: fix #4669 by handling empty decision scores elements #4670
Conversation
test/train-sets/issue4669.txt
Outdated
@@ -0,0 +1,50 @@ | |||
ccb shared |User userID='aUser' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we use simpler example here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted to add the test as is from the issue, I can add the simplified example with a -p too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going back on that. Updated the test to use your example.
@@ -26,7 +26,8 @@ void print_update(VW::workspace& all, const VW::multi_ex& slots, const VW::decis | |||
std::string delim; | |||
for (const auto& slot : decision_scores) | |||
{ | |||
pred_ss << delim << slot[0].action; | |||
if (slot.empty()) { pred_ss << delim << "None"; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add -p to test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it, it shows how suboptimal the empty line is. there's no way to distinguish between it and separators really... (apart from the fact you know two in sequence must be an empty action probs)
@@ -547,6 +552,10 @@ void update_stats_ccb(const VW::workspace& /* all */, shared_data& sd, const ccb | |||
num_labeled++; | |||
if (i == 0 || data.all_slots_loss_report) | |||
{ | |||
// It is possible for the prediction to be empty if there were no actions available at the time of taking the | |||
// slot decision. In this case it does not contribute to loss. | |||
if (preds[i].empty()) { continue; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also exclude this example from denominator? (num_labeled--)
@jackgerrits , looks like new warning should be added to .stdout files |
Closes #4669