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
3ebea75e
Commit
3ebea75e
authored
4 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[utils.measure] Fix docs
parent
205a4b59
No related branches found
No related tags found
No related merge requests found
Pipeline
#39704
failed
4 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bob/ip/binseg/utils/measure.py
+27
-28
27 additions, 28 deletions
bob/ip/binseg/utils/measure.py
doc/links.rst
+3
-0
3 additions, 0 deletions
doc/links.rst
with
30 additions
and
28 deletions
bob/ip/binseg/utils/measure.py
+
27
−
28
View file @
3ebea75e
...
...
@@ -33,52 +33,51 @@ def base_measures(tp, fp, tn, fn):
Calculates a bunch of measures from true/false positive and negative counts
This function can return standard machine learning measures from true and
false positive counts of positives and negatives.
For a thorough look into these and alternate names for the returned values,
please check Wikipedia
'
s entry on `Precision and Recall`_.
false positive counts of positives and negatives. For a thorough look into
these and alternate names for the returned values, please check Wikipedia
'
s
entry on `Precision and Recall`_.
Parameters
----------
tp : int
True positive count, AKA
"
hit
"
tp : int
True positive count, AKA
"
hit
"
fp : int
False positive count, AKA,
"
correct rejection
"
fp : int
False positive count, AKA,
"
correct rejection
"
tn : int
True negative count, AKA
"
false alarm
"
, or
"
Type I error
"
tn : int
True negative count, AKA
"
false alarm
"
, or
"
Type I error
"
fn : int
False Negative count, AKA
"
miss
"
, or
"
Type II error
"
fn : int
False Negative count, AKA
"
miss
"
, or
"
Type II error
"
Returns
-------
precision : float
P, AKA positive predictive value (PPV)
:math:`
\f
rac{tp}{tp+fp}`
precision : float
P, AKA positive predictive value (PPV)
:math:`
\f
rac{tp}{tp+fp}`
recall : float
R, AKA sensitivity, hit rate, or true positive rate (TPR)
:math:`
\f
rac{tp}{p} =
\f
rac{tp}{tp+fn}`
recall : float
R, AKA sensitivity, hit rate, or true positive rate (TPR)
:math:`
\f
rac{tp}{p} =
\f
rac{tp}{tp+fn}`
specificity : float
S, AKA selectivity or true negative rate (TNR).
:math:`
\f
rac{tn}{n} =
\f
rac{tn}{tn+fp}`
specificity : float
S, AKA selectivity or true negative rate (TNR).
:math:`
\f
rac{tn}{n} =
\f
rac{tn}{tn+fp}`
accuracy : float
A, :math:`
\f
rac{tp + tn}{p + n} =
\f
rac{tp + tn}{tp + fp + tn + fn}`
accuracy : float
A, :math:`
\f
rac{tp + tn}{p + n} =
\f
rac{tp + tn}{tp + fp + tn + fn}`
jaccard : float
J, :math:`
\f
rac{tp}{tp+fp+fn}`, see `Jaccard Index`_
jaccard : float
J, :math:`
\f
rac{tp}{tp+fp+fn}`, see `Jaccard Index`_
f1_score : float
F1, :math:`
\f
rac{2 P R}{P + R} =
\f
rac{2tp}{2tp + fp + fn}`, see
`F1-score`_
f1_score : float
F1, :math:`
\f
rac{2 P R}{P + R} =
\f
rac{2tp}{2tp + fp + fn}`, see
`F1-score`_
"""
...
...
This diff is collapsed.
Click to expand it.
doc/links.rst
+
3
−
0
View file @
3ebea75e
...
...
@@ -9,6 +9,9 @@
.. _pytorch: https://pytorch.org
.. _tabulate: https://pypi.org/project/tabulate/
.. _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
.. _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