MCPcopy Index your code
hub / github.com/ujjwalkarn/DataSciencePython / logloss

Function logloss

Logistic-Regression/citreo.py:40–42  ·  view source on GitHub ↗
(p, y)

Source from the content-addressed store, hash-verified

38# OUTPUT
39# logarithmic loss of p given y
40def logloss(p, y):
41 p = max(min(p, 1. - 10e-12), 10e-12)
42 return -log(p) if y == 1. else -log(1. - p)
43
44
45# B. Apply hash trick of the original csv row

Callers 1

citreo.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected