FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PythonForDataScience/logloss.py at master · codetasks/PythonForDataScience · GitHub
codetasks
PythonForDataScience
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
PythonForDataScience
/
logloss.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
8 lines (8 loc) · 258 Bytes
Breadcrumbs
PythonForDataScience
/
logloss.py
Copy path
File metadata and controls
8 lines (8 loc) · 258 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
import
scipy
as
sp
def
llfun
(
act
,
pred
):
epsilon
=
1e-15
pred
=
sp
.
maximum
(
epsilon
,
pred
)
pred
=
sp
.
minimum
(
1
-
epsilon
,
pred
)
ll
=
sum
(
act
*
sp
.
log
(
pred
)
+
sp
.
subtract
(
1
,
act
)
*
sp
.
log
(
sp
.
subtract
(
1
,
pred
)))
ll
=
ll
*
-
1.0
/
len
(
act
)
return
ll
Back
|
FazBrowse Home
|
New Git URL