Science Score: 33.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
✓Committers with academic emails
2 of 5 committers (40.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.8%) to scientific vocabulary
Last synced: 10 months ago
·
JSON representation
Repository
Basic Info
- Host: GitHub
- Owner: tdhock
- Language: R
- Default Branch: main
- Size: 319 KB
Statistics
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 2
- Releases: 0
Created over 5 years ago
· Last pushed over 1 year ago
Metadata Files
Readme
Changelog
README.org
Area Under the Minimum (AUM) of False Positives and Negatives
| [[file:tests/testthat][tests]] | [[https://github.com/tdhock/aum/actions][https://github.com/tdhock/aum/workflows/R-CMD-check/badge.svg]]
| [[https://github.com/jimhester/covr][coverage]] | [[https://coveralls.io/github/tdhock/aum?branch=master][https://coveralls.io/repos/tdhock/aum/badge.svg?branch=main&service=github]] |
This R package provides an efficient C++ implementation of the [[https://jmlr.org/papers/v24/21-0751.html][AUM]],
which can be used as a surrogate loss for
optimizing Area Under the ROC Curve (AUC) in supervised binary
classification and changepoint detection problems.
** Installation
#+begin_src R
install.packages("aum")
## OR:
if(!requireNamespace("remotes"))install.packages("remotes")
remotes::install_github("tdhock/aum")
#+end_src
** Usage
*** Converting binary labels to aum_diffs
The code below creates an =aum_diffs= data table which represents error
functions for two labeled examples in binary classification.
#+begin_src R
> (bin.diffs <- aum::aum_diffs_binary(c(0,1)))
example pred fp_diff fn_diff
1: 0 0 1 0
2: 1 0 0 -1
#+end_src
- The first row above means there is a false positive difference of 1
at a predicted value of 0. This is the error function for each
example with a negative label in binary classification (no error if
predicted value less than 0, changes up to 1 false positive for
larger predicted values).
- The second row means there is a false negative difference of -1 at a
predicted value of 0. This is the error function for each example
with a positive label in binary classification (1 false negative if
predicted value less than 0, changes down to no errors for larger
predicted values).
*** Computing AUM from aum_diffs table and prediction vector
Next we assume predicted values of 0 for both examples, and then
compute Area Under the Minimum (AUM) of False Positives and False
Negatives and its directional derivatives.
#+begin_src R
> aum::aum(bin.diffs, c(0,0))
$aum
[1] 0
$derivative_mat
[,1] [,2]
[1,] 0 1
[2,] -1 0
#+end_src
The result above is a named list with two elements.
- =aum= is a numeric value giving the AUM for the specified error
functions and predicted values.
- =derivative_mat= is a matrix of directional derivatives, one row for
each example (first column for left directional derivative, second
column for right). In the example above we can see that decreasing
the first prediction (entry 1,1) and/or increasing the second
prediction (entry 2,2) results in no change to AUM. Since the right
directional derivative of the first example is positive (entry 1,2),
that implies an increased prediction would result in an increased
AUM. Similarly the left directional derivative for the second
example is negative (entry 2,1), indicating that a decreased
prediction would result in an increased AUM.
*** Changepoint detection
See =?aum::aum_diffs_penalty= for documentation about how to compute
the AUM for supervised penalty learning in changepoint detection problems.
*** Line search
An exact line search can be computed using time which is log-linear in
the number of step sizes, see =?aum::aum_line_search= for a single
line search, and =?aum::aum_linear_model_cv= for using the line search
in each step of gradient descent when learning a linear model.
** Related Work
- [[https://github.com/tdhock/penaltyLearning/blob/master/R/ROChange.R][penaltyLearning::ROChange]] provides an alternative implementation of
AUM and its directional derivatives in R data.table code (slower,
also includes ROC curve computation).
- [[https://cloud.r-project.org/web/packages/aum/vignettes/speed-comparison.html][The speed comparison vignette]] has an alternative implementation of
AUM and its directional derivatives in base R code.
- [[https://github.com/tdhock/max-generalized-auc][max-generalized-auc]] repo provides code for making the figures in
https://arxiv.org/abs/2107.01285 and https://arxiv.org/abs/2410.08635
- Blogs about [[https://tdhock.github.io/blog/2022/torch-auto-grad-non-diff/][a pytorch implementation of AUM for binary classification]], and [[https://tdhock.github.io/blog/2024/torch-roc-aum/][computing AUC and AUM in torch]].
Owner
- Name: Toby Dylan Hocking
- Login: tdhock
- Kind: user
- Location: Flagstaff, AZ
- Company: Northern Arizona University
- Website: http://tdhock.github.io
- Repositories: 88
- Profile: https://github.com/tdhock
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Toby Dylan Hocking | T****g@n****u | 55 |
| Toby Dylan Hocking | t****5@g****m | 53 |
| Toby Dylan Hocking | t****g@r****g | 10 |
| Toby Dylan Hocking | t****g@n****u | 7 |
| jado | j@j****o | 5 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 2
- Total pull requests: 5
- Average time to close issues: about 2 months
- Average time to close pull requests: about 1 month
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 4.0
- Average comments per pull request: 3.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 1
- Average time to close issues: N/A
- Average time to close pull requests: about 13 hours
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- tdhock (2)
Pull Request Authors
- tdhock (4)
- phase (1)
Top Labels
Issue Labels
Pull Request Labels
enhancement (1)
Packages
- Total packages: 1
-
Total downloads:
- cran 660 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 4
- Total maintainers: 1
cran.r-project.org: aum
Area Under Minimum of False Positives and Negatives
- Homepage: https://github.com/tdhock/aum
- Documentation: http://cran.r-project.org/web/packages/aum/aum.pdf
- License: GPL-3
-
Latest release: 2024.6.19
published about 2 years ago
Rankings
Forks count: 17.8%
Dependent packages count: 29.8%
Stargazers count: 31.7%
Average: 32.3%
Dependent repos count: 35.5%
Downloads: 46.9%
Maintainers (1)
Last synced:
11 months ago