Question
Compute the binary cross-entropy (log loss) of a classifier. Given y_true (labels 0/1) and y_prob (predicted probabilities of the positive class, each in [0,1]), the log loss is the negative mean over samples of y*ln(p) + (1-y)*ln(1-p). To avoid log(0), clip every probability into the range [eps, 1-eps] with eps = 1e-15 before taking logs. Return the mean log loss rounded to 6 decimal places. The lists are non-empty and equal length, up to 10^5 elements.
log_loss(y_true: list[int], y_prob: list[float]) → float[[1,0],[0.9,0.1]]out0.105361State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.