Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
deepdraw
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
medai
software
deepdraw
Commits
87a6e0c6
Commit
87a6e0c6
authored
4 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[utils.measure] Fix docstring
parent
3ebea75e
No related branches found
No related tags found
No related merge requests found
Pipeline
#39705
passed
4 years ago
Stage: build
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bob/ip/binseg/utils/measure.py
+23
-27
23 additions, 27 deletions
bob/ip/binseg/utils/measure.py
doc/api.rst
+3
-0
3 additions, 0 deletions
doc/api.rst
doc/links.rst
+0
-3
0 additions, 3 deletions
doc/links.rst
with
26 additions
and
30 deletions
bob/ip/binseg/utils/measure.py
+
23
−
27
View file @
87a6e0c6
...
@@ -29,55 +29,51 @@ class SmoothedValue:
...
@@ -29,55 +29,51 @@ class SmoothedValue:
def
base_measures
(
tp
,
fp
,
tn
,
fn
):
def
base_measures
(
tp
,
fp
,
tn
,
fn
):
"""
"""
Calculates measures from true/false positive and negative counts
Calculates a bunch of measures from true/false positive and negative counts
This function can return standard machine learning measures from true and
This function can return standard machine learning measures from true and
false positive counts of positives and negatives. For a thorough look into
false positive counts of positives and negatives. For a thorough look into
these and alternate names for the returned values, please check Wikipedia
'
s
these and alternate names for the returned values, please check Wikipedia
'
s
entry on `Precision and Recall`_.
entry on `Precision and Recall
<https://en.wikipedia.org/wiki/Precision_and_recall>`_.
Parameters
Parameters
----------
----------
tp : int
tp : int
True positive count, AKA
"
hit
"
True positive count, AKA
"
hit
"
fp : int
fp : int
False positive count, AKA,
"
correct rejection
"
False positive count, AKA,
"
correct rejection
"
tn : int
tn : int
True negative count, AKA
"
false alarm
"
, or
"
Type I error
"
True negative count, AKA
"
false alarm
"
, or
"
Type I error
"
fn : int
fn : int
False Negative count, AKA
"
miss
"
, or
"
Type II error
"
False Negative count, AKA
"
miss
"
, or
"
Type II error
"
Returns
Returns
-------
-------
precision : float
precision : float
P, AKA positive predictive value (PPV)
P, AKA positive predictive value (PPV).
:math:`
\f
rac{tp}{tp+fp}`
recall : float
recall : float
R, AKA sensitivity, hit rate, or true positive rate (TPR)
R, AKA sensitivity, hit rate, or true positive rate (TPR).
:math:`
\f
rac{tp}{p} =
\f
rac{tp}{tp+fn}`
specificity : float
specificity : float
S, AKA selectivity or true negative rate (TNR).
S, AKA selectivity or true negative rate (TNR).
:math:`
\f
rac{tn}{n} =
\f
rac{tn}{tn+fp}`
accuracy : float
accuracy : float
A, :math:`
\f
rac{tp + tn}{p + n} =
\f
rac{tp + tn}{tp + fp + tn + fn}`
A
jaccard : float
jaccard : float
J, :math:`
\f
rac{tp}{tp+fp+fn}`, see `
Jaccard
I
ndex`_
J, see `Jaccard Index <https://en.wikipedia.org/wiki/
Jaccard
_i
ndex
>
`_
f1_score : float
f1_score : float
F1, :math:`
\f
rac{2 P R}{P + R} =
\f
rac{2tp}{2tp + fp + fn}`, see
F1, see `F1-score <https://en.wikipedia.org/wiki/F1_score>`_
`F1-score`_
"""
"""
...
...
This diff is collapsed.
Click to expand it.
doc/api.rst
+
3
−
0
View file @
87a6e0c6
...
@@ -185,3 +185,6 @@ Datasets
...
@@ -185,3 +185,6 @@ Datasets
bob.ip.binseg.configs.datasets.drionsdb.expert1
bob.ip.binseg.configs.datasets.drionsdb.expert1
bob.ip.binseg.configs.datasets.drionsdb.expert2
bob.ip.binseg.configs.datasets.drionsdb.expert2
.. include:: links.rst
This diff is collapsed.
Click to expand it.
doc/links.rst
+
0
−
3
View file @
87a6e0c6
...
@@ -9,9 +9,6 @@
...
@@ -9,9 +9,6 @@
.. _pytorch: https://pytorch.org
.. _pytorch: https://pytorch.org
.. _tabulate: https://pypi.org/project/tabulate/
.. _tabulate: https://pypi.org/project/tabulate/
.. _our paper: https://arxiv.org/abs/1909.03856
.. _our paper: https://arxiv.org/abs/1909.03856
.. _precision and recall: https://en.wikipedia.org/wiki/Precision_and_recall
.. _f1-score: https://en.wikipedia.org/wiki/F1_score
.. _jaccard index: https://en.wikipedia.org/wiki/Jaccard_index
.. Raw data websites
.. Raw data websites
.. _drive: https://www.isi.uu.nl/Research/Databases/DRIVE/
.. _drive: https://www.isi.uu.nl/Research/Databases/DRIVE/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment