Skip to content

Commit

Permalink
Merge branch 'main' into mauc
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Aug 20, 2024
2 parents def0106 + 5fb059a commit ecf5f70
Show file tree
Hide file tree
Showing 109 changed files with 841 additions and 290 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@
^\.ccache$
^\.lintr$
^docs$
^scratch$
^revdep$
^CRAN-SUBMISSION$
^cran-comments\.md$
97 changes: 96 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,100 @@
.Rproj.user
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,linux,r
# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,linux,r

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### R ###
# History files
.Rhistory
.Rapp.history

# Session Data files
.RData
.RDataTmp

# User-specific files
.Ruserdata

# Example code in package build process
*-Ex.R

# Output files from R CMD build
/*.tar.gz

# Output files from R CMD check
/*.Rcheck/

# RStudio files
.Rproj.user/

# produced vignettes
vignettes/*.html
vignettes/*.pdf

# OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3
.httr-oauth

# knitr and R markdown default cache directories
*_cache/
/cache/

# Temporary files created by R markdown
*.utf8.md
*.knit.md

# R Environment Variables
.Renviron

# pkgdown site
docs/

# translation temp files
po/*~

# RStudio Connect folder
rsconnect/

### R.Bookdown Stack ###
# R package: bookdown caching files
/*_files/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,linux,r

# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)

revdep/
cran-comments.md
CRAN-SUBMISSION
6 changes: 3 additions & 3 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
linters: with_defaults(
# lintr defaults: https://github.com/jimhester/lintr#available-linters
linters: linters_with_defaults(
# lintr defaults: https://lintr.r-lib.org/reference/default_linters.html
# the following setup changes/removes certain linters
assignment_linter = NULL, # do not force using <- for assignments
object_name_linter = object_name_linter(c("snake_case", "CamelCase")), # only allow snake case and camel case object names
cyclocomp_linter = NULL, # do not check function complexity
commented_code_linter = NULL, # allow code in comments
line_length_linter = line_length_linter(120)
line_length_linter = line_length_linter(120L)
)

32 changes: 16 additions & 16 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
Package: mlr3measures
Title: Performance Measures for 'mlr3'
Version: 0.5.0-9000
Authors@R:
c(person(given = "Michel",
family = "Lang",
role = c("cre", "aut"),
email = "michellang@gmail.com",
comment = c(ORCID = "0000-0001-9754-0393")),
person(given = "Martin",
family = "Binder",
role = "ctb",
email = "mlr.developer@mb706.com"))
Description: Implements multiple performance measures for
supervised learning. Includes over 40 measures for regression and
Version: 0.6.0.9000
Authors@R: c(
person("Michel", "Lang", , "michellang@gmail.com", role = "aut",
comment = c(ORCID = "0000-0001-9754-0393")),
person("Martin", "Binder", , "mlr.developer@mb706.com", role = "ctb"),
person("Marc", "Becker", , "marcbecker@posteo.de", role = c("cre", "aut"),
comment = c(ORCID = "0000-0002-8115-0400")),
person("Lona", "Koers", , , role = "aut")
)
Description: Implements multiple performance measures for supervised
learning. Includes over 40 measures for regression and
classification. Additionally, meta information about the performance
measures can be queried, e.g. what the best and worst possible
performances scores are.
Expand All @@ -28,10 +26,10 @@ Imports:
PRROC
Suggests:
testthat (>= 3.0.0)
Encoding: UTF-8
Config/testthat/edition: 3
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Collate:
'assertions.R'
'bibentries.R'
Expand All @@ -48,7 +46,6 @@ Collate:
'binary_fpr.R'
'binary_gmean.R'
'binary_gpr.R'
'binary_mcc.R'
'binary_npv.R'
'binary_ppv.R'
'binary_prauc.R'
Expand All @@ -62,13 +59,15 @@ Collate:
'classif_ce.R'
'classif_logloss.R'
'classif_mbrier.R'
'classif_mcc.R'
'classif_zero_one.R'
'confusion_matrix.R'
'helper.R'
'regr_ae.R'
'regr_ape.R'
'regr_bias.R'
'regr_ktau.R'
'regr_linex.R'
'regr_mae.R'
'regr_mape.R'
'regr_maxae.R'
Expand All @@ -78,6 +77,7 @@ Collate:
'regr_mse.R'
'regr_msle.R'
'regr_pbias.R'
'regr_pinball.R'
'regr_rae.R'
'regr_rmse.R'
'regr_rmsle.R'
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export(gmean)
export(gpr)
export(jaccard)
export(ktau)
export(linex)
export(logloss)
export(mae)
export(mape)
Expand All @@ -40,8 +41,10 @@ export(medse)
export(mse)
export(msle)
export(npv)
export(one_zero)
export(pbias)
export(phi)
export(pinball)
export(ppv)
export(prauc)
export(precision)
Expand Down
12 changes: 8 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# bbotk (development version)
# mlr3measures (development version)

* Added new measure `linex` (Linear-Exponential Loss).
* Added new measure `pinball` (Average Pinball Loss).
* Added new measure `mauc_mu` (Mu AUC).

# mlr3measures 0.6.0

* Added multiclass mu AUC measure `mauc_mu`.
* Added binary classification measures `gmean` and `gpr`.
* Added new measure `mcc` (Matthews Correlation Coefficient).

# mlr3measures 0.5.0

Expand All @@ -13,15 +19,13 @@
* Calculation of `fbeta` is now more numerically more stable.
* Improved documentation.


# mlr3measures 0.4.0

* New measures to calculate set similarities: `jaccard` and `phi`.
* Many measures now support sample weights.
Supported measures have `$sample_weights` set to `TRUE` in the `measures`
environment.


# mlr3measures 0.3.1

* Fix edge case for `msle` and `rmsle`.
Expand Down
10 changes: 10 additions & 0 deletions R/bibentries.R
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,15 @@ bibentries = c( # nolint start
volume = "97",
series = "Proceedings of Machine Learning Research",
publisher = "PMLR"
),
varian_1975 = bibentry("incollection",
title = "A Bayesian Approach to Real Estate Assessment",
author = "Varian, Hal R.",
booktitle = "Studies in Bayesian Econometrics and Statistics: In Honor of Leonard J. Savage",
editor = "Stephen E. Fienberg and Arnold Zellner",
year = "1975",
publisher = "North-Holland",
address = "Amsterdam",
pages = "195--208"
)
) # nolint end
10 changes: 4 additions & 6 deletions R/binary_bbrier.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
#'
#' @details
#' The Binary Brier Score is defined as \deqn{
#' \frac{1}{n} \sum_{i=1}^n w_i (I_i - p_i)^2.
#' \frac{1}{n} \sum_{i=1}^n w_i (I_i - p_i)^2,
#' }{
#' weighted.mean(((t == positive) - p)^2, w).
#' }
#' \if{latex}{
#' \eqn{w_i} are the sample weights,
#' \eqn{I_{i}}{I_i} is 1 if observation \eqn{i} belongs to the positive class, and 0 otherwise.
#' weighted.mean(((t == positive) - p)^2, w),
#' }
#' where \eqn{w_i} are the sample weights,
#' and \eqn{I_{i}} is 1 if observation \eqn{x_i} belongs to the positive class, and 0 otherwise.
#'
#' Note that this (more common) definition of the Brier score is equivalent to the
#' original definition of the multi-class Brier score (see [mbrier()]) divided by 2.
Expand Down
2 changes: 1 addition & 1 deletion R/binary_fbeta.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#' @inheritParams binary_params
#' @param beta (`numeric(1)`)\cr
#' Parameter to give either precision or recall more weight.
#' Default is 1, resulting in balanced weights.
#' Default is `1`, resulting in balanced weights.
#' @template binary_example
#' @export
fbeta = function(truth, response, positive, beta = 1, na_value = NaN, ...) {
Expand Down
2 changes: 1 addition & 1 deletion R/binary_fn.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @details
#' This measure counts the false negatives (type 2 error), i.e. the number of
#' predictions indicating a negative class label while in fact it is positive.
#' This is sometimes also called a "false alarm".
#' This is sometimes also called a "miss" or an "underestimation".
#'
#' @templateVar mid fn
#' @template binary_template
Expand Down
1 change: 1 addition & 0 deletions R/binary_fp.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#' @details
#' This measure counts the false positives (type 1 error), i.e. the number of
#' predictions indicating a positive class label while in fact it is negative.
#' This is sometimes also called a "false alarm".
#'
#' @templateVar mid fp
#' @template binary_template
Expand Down
2 changes: 1 addition & 1 deletion R/binary_gmean.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @details
#' Calculates the geometric mean of [recall()] R and [specificity()] S as \deqn{
#' \sqrt{\mathrm{R} \mathrm{S}}.
#' \sqrt{\mathrm{R} \cdot \mathrm{S}}.
#' }{
#' sqrt(R * S)
#' }
Expand Down
2 changes: 1 addition & 1 deletion R/binary_gpr.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @details
#' Calculates the geometric mean of [precision()] P and [recall()] R as \deqn{
#' \sqrt{\mathrm{P} \mathrm{R}}.
#' \sqrt{\mathrm{P} \cdot \mathrm{R}}.
#' }{
#' sqrt(P * R)
#' }
Expand Down
41 changes: 0 additions & 41 deletions R/binary_mcc.R

This file was deleted.

2 changes: 1 addition & 1 deletion R/binary_prauc.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' Computes the area under the Precision-Recall curve (PRC).
#' The PRC can be interpreted as the relationship between precision and recall (sensitivity),
#' and is considered to be a more appropriate measure for unbalanced datasets than the ROC curve.
#' The PRC is computed by integration of the piecewise function.
#' The AUC-PRC is computed by integration of the piecewise function.
#'
#' @templateVar mid prauc
#' @template binary_template
Expand Down
2 changes: 1 addition & 1 deletion R/binary_tn.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @details
#' This measure counts the true negatives, i.e. the number of
#' predictions correctly indicating a negative class label.
#' predictions correctly indicating a negative class label. This is sometimes also called a "correct rejection".
#'
#' @templateVar mid tn
#' @template binary_template
Expand Down
2 changes: 1 addition & 1 deletion R/binary_tnr.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' }{
#' TN / (FP + TN).
#' }
#' Also know as "specificity".
#' Also know as "specificity" or "selectivity".
#'
#' @templateVar mid tnr
#' @template binary_template
Expand Down
Loading

0 comments on commit ecf5f70

Please sign in to comment.