Compute binary log loss independently for every sample. Clip each predicted probability before applying the logarithm:
p=min(1−ε,max(ε,p)) L(y,p)=−[yln(p)+(1−y)ln(1−p)]Here, y is a binary target, p is its predicted probability, and ε is eps. Use the natural logarithm and return a list of losses in input order.
Input: y_true = [1, 0, 1], y_pred = [0.9, 0.1, 0.8], eps = 1e-15
Output: [0.105361, 0.105361, 0.223144]
Explanation: Each confident correct prediction produces a small positive loss.
Input: y_true = [1, 0], y_pred = [1, 0], eps = 1e-15
Output: [0, 0]
Clip with max(eps, min(1 - eps, probability)).
Append -(y * math.log(p) + (1 - y) * math.log(1 - p)) for each pair.
Sign in to take notes on this problem
Accepts: array
Accepts: array
Accepts: number
Compute binary log loss independently for every sample. Clip each predicted probability before applying the logarithm:
p=min(1−ε,max(ε,p)) L(y,p)=−[yln(p)+(1−y)ln(1−p)]Here, y is a binary target, p is its predicted probability, and ε is eps. Use the natural logarithm and return a list of losses in input order.
Input: y_true = [1, 0, 1], y_pred = [0.9, 0.1, 0.8], eps = 1e-15
Output: [0.105361, 0.105361, 0.223144]
Explanation: Each confident correct prediction produces a small positive loss.
Input: y_true = [1, 0], y_pred = [1, 0], eps = 1e-15
Output: [0, 0]
Clip with max(eps, min(1 - eps, probability)).
Append -(y * math.log(p) + (1 - y) * math.log(1 - p)) for each pair.
Sign in to take notes on this problem
Accepts: array
Accepts: array
Accepts: number