Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/ujjwalkarn/DataSciencePython
/ logloss
Function
logloss
Logistic-Regression/citreo_code_v2.py:23–25 ·
view source on GitHub ↗
(p, y)
Source
from the content-addressed store, hash-verified
21
# OUTPUT
22
# logarithmic loss of p given y
23
def
logloss(p, y):
24
p = max(min(p, 1. - 10e-12), 10e-12)
25
return
-log(p)
if
y == 1.
else
-log(1. - p)
26
27
28
# B. Apply hash trick of the original csv row
Callers
1
citreo_code_v2.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected